any updates regarding Offline Data mode ?
Currently my app is not opening when the Internet is unavailable, because it fails on login.
I don’t know how to deal with it.
How would you suggest to manage user login/logout when in offline ?
We will be revisiting offline data mode after 4.0 is released in the Cloud (which is soon).
The issue of login without internet would not be entirely solved even when the offline mode is fully supported. The app would need to be designed in a way which provides a workflow for the user to work without internet. Have you thought what that workflow would be?
These are good news, about the offline data mode.
Currently my application perform login on start in the following way,after making sure of valid token :
String currentUserId = Backendless.UserService.loggedInUser();
if( !currentUserId.equals( "" ) )
Backendless.UserService.findById( currentUserId, new MyCallback<BackendlessUser>( MainActivitySplash.this, "Logging in..." )
public void handleResponse( BackendlessUser currentUser )
super.handleResponse( currentUser );
Backendless.UserService.setCurrentUser( currentUser );
Intent intent = new Intent(getBaseContext(), MyMainActivity.class);
public void handleFault( BackendlessFault fault )
System.err.println( "Error - " + fault );
Then i load the databases of the current user.
In case of offline i would like to load the offline databases that will allow the application to continue with regular workflow, and synchronize the databases when onlline, but how should i manage the user login?
The offline database should be locked on the specific user, so it seems that i must save the last user in a file, and, if offline, use it to unlock the offline database ?
I have no experience in this kind of issues, i would like to use the common solution, that probably use Whatsapp with its chat database, or Google with gmail app database.
How would you recommend to do that based on BE resources ?
You would need to have some copy of the database to implement that, but I suppose it’s not really possible right now since you can’t retrieve the user’s password from the backend. Of course you could save it in your app when the user logs in, but it won’t be any secure.
Though if you don’t need a high level of security, your approach with saving the last user somewhere would work fine.
Good news is that we’re already working on the offline functionality and hope it’ll appear online in the next few months.