I install the couchbase server 6.5 and create bucket, and connect sync gateway with CB server successfully, however for Couchbase lite in android mobile, I have some problems when build the project. However when I add the Starter code https://docs.couchbase.com/couchbase-lite/2.7/java-android.html I get some errors such as context can not be null. Is there any sample source code for couchbase 2.7 that I can use? Also what is context? I created getting-started-db bucket.
error: cannot find symbol
symbol: variable context
location: class MainActivity
As indicated in the tutorial, the walrus is only for demo purposes so I would strongly recommend that you setup a Couchbase Server and connect to the sync gateway first.
We can then start troubleshooting if users are getting created correctly by first querying for users via the users REST endpoint or on the server.
I add the data using Android app. When I input data for name, address and image, it doesnt save in sync gateway. I just create new bucket and change the bucketname in sync gateway. In the App also I changed the DB name.
I changed the userProfileDbName in the Android app, DataBasemanager.java file.
private static String userProfileDbName = “newdb”
Is there any other file I need to change in the App?
I can see that data is in sync gateway, but when I click on Save button in the App, the data just show empty.
I think public void changed(QueryChange change) in the android doesnt work and I get null data, do I need to change the Dictionary dictionary = row.getDictionary(“userprofile”) to new database?
I will use mobile Login SDK which the user should login using that, probably I use custom authentication. is there any source code related to that? The different between custom authentication and implicit flow is just in the implicit flow the authentication happen by third party and in custom authentication we already have authentication token and we create session? In both part we need to create the user in couchbase before creating session?
Check out this blog on custom authentication
In both causes user must be created on Sync Gateway. You have a choice of letting sync gateway automatically create the user after initial authentication by enabling the register config. If you want to statically associated channels with the user, you will have to do a PUT _user to update the user with channels.
Thanks for support. Register config is string, what value should I specify for that?(is there any sample json file?)
Also when user automatically created, do we need to specify password?
My understanding is, after authentication, we need to create the user in sync gateway, and then we can create session and channel for that users. is that correct?