Cordova app storage - android

I am new to cordova app development and I am not sure how to approach this application workflow.
The workflow is that:
1. user download and installs the app
2. he ca use basic feature without registration
During this time (unregistered user with app installed) on backend we have to track the user activity and in case he register using email to upgrade his profile and keep his previous activity.
A solution to this will be to generate a user GUID on mobile when user first install the app. Send it to backend and use this as a future reference of the user.
Where can I store this GUID to be reliable and not to be cleared by the browser/application cache. If user clears the application data I would like the GUID to stay.
It will be great if this setting will stay if user upgrade the app or uninstall and reinstall later.
V Best,
Radu

You shouldn't storage data in a device when the user uninstall it, but if you still want it, check this plugin:
https://github.com/apache/cordova-plugin-file
You can save in different locations, even in the external storage of the device, which doesn't get deleted when the app is unistalled

Cordova unique device id plugin generate a UUID that remains the same after app uninstall and works on iOS and Android.
On iOS it generates a UUID and store it in the Keychain.
On Android it concatenates various IDs unique to the device but needs the android.permission.READ_PHONE_STATE permission.

Related

Dynamically changes in android installed app those changes reach to live users installed app

I actually want's to reach app changes in to user installed app.How this can possible.
1- My app is live on play store.
2- There are 30,000 of live users.
There is a bug in app and i resolved that bug now i don't want to upload new version of app on play store there is only small change so i don not update that version to play store now i don't want all users will update for small change updated build.
What i need to do for this if there is any tool to user device installed app that bug fixed which is i resolved.
I am not using Web-services for that change so data is not depend on web server.
Is there any tool or any other way to reach users installed device that change for that all these changes reflect to user installed app??.
without any user authentication by playstore.
or is there any way to reach these changes to user device.
No, like it or not, but there's no mechanism you can use to replace installed app or hot swap it portions on user's device other than reinstall.
In future release you could add ie push messages telling user to download the update from your server (but that would require enabled sideloading to have it installed).
There is only single answer all over the stack or E- bloggers as well google Developers answers.
We can upload our build at Google play store at Strict mode , Strict mode make without user authentication or permissions update build and that build reach to user installed device .
In case of (User must have Internet connection or when user get connected by internet or WiFi same time app automatically update without any User Intersection or this process user can not view that particular app is updated or not) if user know this particular app previous version like "1.1" and now "1.2" then only user can understand app is updated in my device without user permission.
Google added this in Play store publisher account this feature for Developers some of the developers know very well but some not.
All changes Reach to user installed app in this case user not required to make app update from Play Store.

How can the application detect the user and/or the device have never installed the application before

Scenario
The user get only the first time free credits in the app. After that we want to do fraud prevention. We need to check if the user and/or the device have not installed the application before.
We can accept the risk of a factory reset or rooted devices
What I tried already
Listen to Intent.ACTION_PACKAGE_FIRST_LAUNCH. After reading I understand that this event is only send to the Play store and can't be used in any other app.
Check the application package info for the field "firstInstallTime", this is reset when the user removed the application and do a install.
Android Backup Service, but the user can stop the backup and reset data, so this is at no use.
App licensing looks like a promise solution to detect if the user have already installed the app. But with limitations the following is described: "You can implement licensing controls for a free app, but only if you're using the service to provide APK expansion files." Do we need to make a small APK expension file, just to verify the license?"
make a fingerprint of the mac address, imei, android id and some other stuff. But would this make the scans of Google play violating? I don't use it for advertising, but i'm afraid they think we violate the google play policy.
how you can help me
Can you help me to choose a good direction to solve this issue and maybe give some better methods to do this verification.
Factory reset, second-hand phones and users with multiple devices will be your main problems.
The only way to uniquely identify a user is an authentication through login/password or OpenId account.
Hey there if you are managing user information at the your server than what you can do is take the IMEI number of the device and send it to your server. It will record the information of the user. Now if he/she uninstall and install app again your app will again send IMEI number at server now you can check the IMEI already present or not, If present then user have already installed your application, more over you can manage same thing from the login ID, but that can be faked by the user. More over it will not violate any thing. User can see while installing in the permissions that your app will get the system information.

Android Apk Distribution

I have a question on the apk distribution. We all know that we can distribute apks through bluetooth, emails etc.
Now, when I download any apk from the google play, the app gets installed and that we cannot share it by using the licensing policies.
I have my apk on a website. I want the same thing. I want fresh installs from the website also. The app should not shared with any1.
Is there any way to this? Any suggestions on how to do this?
As I said in comment, You can not stop users to forward your apk if they have them in storage, what you can do is to delete it after your app installed, but it can be shared before installing.
and there are tools/apps exist in market which claim to convert installed app into apk, and then it can be forwarded to other device.
Similar question on Forward locking of apk
Edit :- though you can not stop user to forwarding of your apk, But can stop other user to use it, if they receive this app from other sources then your web, as I myself did it earlier, by client server communication where a key is getting generated on Server based on mobile IMEI, so this app is going to be activated for particular mobile based on IMEI number. hence if other users try to use it you can check if this IMEI is register or not, and take action accordingly.

Check whether application is installed or uninstalled

Can I define that application was installed earlier? For example I can check whether application is installed or not installed but if application was installed and later was uninstalled. Is there way to check it or not?
Phone does not store any information about the uninstalled app. If ur app has a backend, then try saving UDID in the server when app is installed. So that u can check next time whether the app is once installed and uninstalled in a phone. But if ur app is a stand alone app with out any server, u cant do that.
Uninstalled apps are per default leaving no trace on the phone.
If it is your own app you want to check whether was installed and later uninstalled you could code your app to leave a trace, either on a server (sending the phone ID to the server) or on the SD Card. Both methods requires permissions.
If it isnt your own app you want to check whether was installed and later uninstalled you are out of luck, sorry.
You could create a file on the SD card when the application is installed the first time.
Then when it's reinstalled, your application will check the presence of this file.
If you are supporting FCM in your app .
Than have a look at the server side api for sending the notifications
If sending fails to a user , we can consider that user has uninstalled the app.
Have a look at the following article.
https://medium.com/what-is-singleton-pattern-and-why-we-need-them/how-to-track-uninstalled-users-from-app-using-fcm-afdba7301116
I haven't gone though backend apis for FCM. not sure whether we get this info while pushing out a notification to a single user or a group of users.
my intention is that try for FCM if it useful for you to determine the install/uninstall status

How do I let some users to install for free a paid Android App?

I am developing an Android application, and common users have to pay for it. But, I want to offer that application for free to my webpage users. I have a login in that webpage, so I can control what users access to the application. So the question is:
If I put the .apk into the private zone of my webpage, and users access it through the mobile, Do they download the application and can distribute it, or it just get installed on the phone?
And what if they access by PC?
Is there any way to avoid the download of the file, and just install it on the phone?
I fear installing without downloading is not possible, maybe you shoud think about a second version which needs a key (e.g. created by the device ID and a secret Prefix.
User is downloading your apk
User get the message he needs to register
User send his Device ID to yor Webpage (and have to login before)
Your Website create a hashkey with the device ID and a secret password
The Application stored the key in the Preferences and will check at startup, if the stored key fit to the Device ID/password Hash.
If you let some download your apk, then it just get downloaded. Users will have to install it manually and what is worse, they won't get updates through the common android market mechanism.
if they have rooted phone then they can do anything with your apk. there is no security in android even you can get the source code of an app.
in your case the only way is to implement certificates.

Categories

Resources