migrating users from one apk to another - android

We have an app (A1) with significant number of users still active, but we no longer plan to support the app. Now we have another smaller app (A2), which is similar to A1.
Is there any way that when users from A1 update their app from the Play Store that they get A2? Basically, we want to migrate users from A1 to A2.
Of note, the package names are different.

It All depends upon the database. You should research about the database you are using for your app to store users data. Connect the same database to your new app or just copy the all users data from A1's Database to the A2's Database, and implementation for all this depends on your database implementation.
Share your more information about your database, this may help you to get a answer.
You could do this implementation maybe in another language like JavaScript etc. Then in A2 use the same implementations ti read and write the data in users.
But beware that you copy data using the same database structure as you used in A1's Database

Related

Using Room Database, How to I update new data after the app is launched?

I am using Room database. After I launch my pre-populated app to play store how do I update the data for all devices without them having to update the app? The users will not be the ones adding the data...that will be me.
The only way would be to have the source in a central location, perhaps on a server which is checked by the App (perhaps whenever the App is run, perhaps whenever navigating to the Activity or Fragment, perhaps on demand). The central source data could then be refreshed/re-loaded from the centralised location
Perhaps consider Firebase as the source.

Preserving SQLite db data on App Update/Reinstall Rollout Xamarin

I have Xamarin.Forms shared project that I am testing on Android phone currently.
The sqlite db is stored in System.Environment.SpecialFolder.Personal as of now.
I want to make sure that user input data stored in db is preserved:
1 upon each next upgrade I am planning for an app, as well as
2 In additional situation where user removes his app totally and makes a fresh install
(I guess these are two totally different situations, but I might be wrong)
I would like to know whether an update of an App via Google Play Store Update will overwrite db file too, therefore all data be lost? Or will the data be preserved?
What would be the option if a user wanted to preserve his/her data even after an app Uninstall/Reinstall?
In second case, I am considering manual/automatic backup of SpecialFolder.Personal db version in use and storing it as a separate file outside of the package using External_STORAGE permissions.
Then the user will be able to Import data from external db file copy into the one that comes in the package.
Also, how should the Import look like?
Can I simply replace the file with external one?
Any advice on this topic will be very appreciated.
An update from Google Play will not overwrite the db file
If a user uninstalls the application, he will want to delete everything related with the application. So my best solution is to have a synchronize method within your API so that, when the user installs again the application, it will fill the local DB with the requested data.

Sharing data among app user using Realm Mobile Platform

I have a question about users accessing data created by another user. I will explain below with a case study.
I am using Realm Mobile Platform. The app uses Realm Auth to allow users to register by email, google and facebook account. At this moment I am using as a REALM_URL: ...":9080/~/name".
I will try to explain what I would like to achieve with the following example.
Imaging that I have UserA and UserB. Once the users have registered in the app (using SyncUser), they would be redirected to a project activity. Each user would be able to create their own projects. Before Realm Mobile Platform (Realm Mobile Database), user data was stored in user devices. Now, because I am using "~" in the REALM_URL, when users entered in the project activity, the activity requests and shows all the existing projects for that user.
The app has another activity with a search functionality where users can search for public projects. For example, the UserA makes public Project1. UserB should be able to find Project1 and follow it, or ask the owner to become a contributor. Once the UserB follow or get access as a contributor, Project1 should be shown in the Project activity of UserB.
The question is how to make this possible.
Option A: Use a unique and common Realm for all users.
Deleting the "~" from the REALM_URL and adding different fields like "ownerID" to the project RealmObject and a list of subscribed projects to the user RealmObject. This will allow user to query to all the projects (owned and subscribed) in the project activity and search for public projects in the search activity.
Option B: Use two realms, one private for the user data, and one public for projects.
The private would have a REALM_URL including the "~" and the public will be absolute. Later, when a new user sign up the app would give privilege (mayRead, mayWrite, mayManage) through the Access Control.
Which one would be a better option? Is there any other better option?
Thanks
The answer to your question is, it depends. The Realm Mobile Platform (RMP) will automatically handle all of your data sharing, conflict resolution, and syncing across the users. In this way, RMP acts as a server and single source of truth.
Both OptionA and OptionB will require this single source of truth and some knowledge of user access control.
Let's go through the pros and cons of each option.
OptionA:
Pros
Only one database, conflict resolution is done by Realm
Significantly less work on the mobile side, you just listen to
the server
Cons
Potentially difficult to do user access control
OptionB:
Pros
User's private data is completely separate
Cons
You will be responsible for writing the data conflict resolution between the local database and the server
Your app will most likely be larger due to storing multiple databases.
In my experience, dealing with database conflict-resolution yourself is truly painful. It seems like OptionA is by far your better option.

Import DataBase from another app

I am learning content provider. Now I can get the data base values from one app to another app using of Content provider. Now I want to get entire database from one app to another app.
Now my try is get the value form A app and store that in B app. But the problem is A app having more than 100 tables. So that I decided to get the entire database from A app to B app. Is it possible to get the database from A app and import to B app?
Thanks in Advance.
On an un-rooted device? No (sandbox). From the application level? No (sandbox again). From adb on an rooted device? Yes.
Any usecase that might need to utilize such functionality? I highly doubt it. Well, maybe if one lost his signing key and tries to rescue the live data from the old app within the new one. Or just trying to be evil by stealing data for blackmailing purposes.
But even if you manage the database, sometimes ContentProviders are more then just a layer around the database (see ContactProvider for example). So even if you have the tables they might be useless unless you also have the provider logic.

Confusion on Activity Lifecycle

I have one app which authenticate user to access internal activity, App is having several activity which gets data from previous activity
So I am bit confused on activity life cycle
I read Bundle data into local variable in activity OnCreate and reading DB in async task based on that data. this DB data is displayed on my app.
Now if I switch to another app, will my app have that local variable/Static variable data (read from DB data) with them,
I have SingleInstance class which keeps user ticket etc informations, Is that variable keeps in memory of app if we got phone call in between.
I am bit confused on this part.
As document suggest that you need to store unsaved data in shared preferences.
It would be good if someone highlight on that..
Well, first of all you need to make sure you understand the difference between a new app and a new activity according to the sentence:
Now if I switch to another app, will my app have that DB data with them after switching back to my app
If you actually mean different apps, the answer is "NO in another app(in case is your app too)" you cannot have access to another application DB (at least not directly), the only way is if that application implemented a content provider to share its data with another application, by default android applications are like sandbox and do not share any information with other apps unless specifically declared, there's another rules between two apps signed with same key but that's a different story and a huge advance topic not related to this question...
In case that you " mean go to another app (not mine) and then try to use it from MY app again " the answer is "YES", the information in the database is accessible among all the building components like "activity, service" that belong to the same application, information in database is persisted even after closing completely the app (and so is shared preference), but there's a huge different between shared preference and DB, and knowing when to use one or another differentiates between good and excellent developers, golden rule (but not the only or the best) is that, DB is used for complex queries and relational data that needs some sort of preprocessing or postprocessing to get the proper values, mean while shared preference is just a "key/value" map that persist in the application context
Hope this Helps.
Regards!

Categories

Resources