Android publish app market automate post purchase tasks - java

If one publish's an app to the Android Market place and post-purchase/download tasks need to be carried out upon the purchase of the app by a customer through the marketplace, how can this be automated? For example, my Android app might require remote connectivity of some kind and so a username and password must be emailed out to them after they have downloaded my app + a record adding to my database..I know I must write a web service of somekind but cant think where to start :o does google checkout accommodate for such post-installation processes?

I am not sure if there is a post-installation callback that Android provides, but this sounds like something that can be done on first startup.
You could have a boolean in the application preferences that is used to determine if the your applications 'setup' has been completed. Any time the application is started, you check the boolean, and if they have already completed setup, you do a typical start, otherwise you prompt the user to go through the setup process.

Related

Difference between Service and PeriodicWorkRequest()

I have to work on a project Where I have to upload users' locations every 15 minutes. For that, I searched a lot and found Recurring work with PeriodicWorkRequest. But the problem is that the WorkManager might not work when the app is closed/killed per the answer given here. Then I found about Service in android.
So I want to know If I want to send users' locations every 15 min even when the app is killed then how to approach this?
If an application is Force Stopped, the OS cancel all the Job related to that application. This is not a WorkManager only problem. The OS interprets a Force Stop as an user request to the OS that they don't want this application to run anymore.
Even if you use JobScheduler or a Service, the application is gone. But a force stop should be a user decision.
Some OEMs have implemented in the past some changes to the Android OS so that a swipe out of an application from the launcher was interpreted as a force stop with all the negative effects on scheduled jobs. This is where the problems start.
WorkManager is this case has implemented some mitigation, but the application cannot do anything if it is force stopped till the user launch it again.
If have a problem with a specific OEMs, please open an issue on the Android issuetracker as this maybe a CDD violation. Google can contact the OEM and request that they fix the ROM. This is going to take time, in the meanwhile, you can take a look at sites like don't kill my app to understand what are the constraints on a specific device and use a library like autostarter to help the user to navigate to the right setting.

Update database on server when app is being uninstalled

I know there might be many questions like my question. But It is different. Actually, I am making a static chart that will show how many devices currently having my Android app installed and how many devices have uninstalled it.
For this, I am creating a uniqueID when the app is installed on a device and saving uniqueID along with FCM token to SQL database on the server.
To Create uniqueID:
uniqueID = UUID.randomUUID().toString()
Now, while I am saving every device with a token and uniqueID to the database. Of course, the device will be considered to have active app installation even when uninstalled the app.
So, I want to add a field in the database as inactive against the device that has uninstalled the app. To achieve this, I am thinking to send a request to the database and update the information when the app uninstallation is triggered.
Is this possible? And if yes, then can anyone please tell me how. Or are there any other method to achieve this. Thanks in advance.
Yes it it possible. You can send a push notification to your app to all your active users everyday from your backend side, and on your Android side, call an API on your server to confirm that you exist. If a client does not confirm his existence in a period of time (like 3 days), you know they have uninstalled the app. This is what Adjust and other statistics do for uninstall statistics.
You can't easily run your own code when an app is uninstalled. It is possible to run code in another app, but that requires that you get the user to install both apps.
In addition to the approach Adib described, you can consider using Google Analytics for Firebase to detect uninstalls of your app by Android users. As shown in the answer to this question, Firebase automatically tracks uninstalls in that case.
Maybe you want to use Firebase Analytics and the event app_remove. Mark it as a conversion and use Functions to remove the user from your Firebase Project(if anonymous) and/or any other data associated with the user(Storage, Database, Firestore, etc.) or anything else you might want to do upon user removal of the app.

How to block application launch in Android

I want to create an application in Android that will show the devices list of applications and then allow the user to select which apps they want to be restricted access to for a certain period of time.
I am aware there is an Android Application named "AppBlock" but i don't know how this works.
You select the app, the period of time and then it doesn't allow you to open the app.
You cannot actually block start of another application.
The only way that I see it is possible: you need to save the list of applications Info in your app that need to be blocked with the time when it need to be blocked. Implement a service that runs "forever" and detects started applications.
Refer to this answer about how to do it. On each detection you should check if application present in your database and if the time now says it need to be blocked. If it is - close the application. Refer to this answer for learning how to do it.
That is global architecture I think you should follow.
To Build App Block u need the following things
1-Accessibity services (AS)2-Forground Services (FS)
BY AS you will be able to stop activity that you have in your bloker list
FS will alive your application context that help to find block app

Android automatically download and install apk

we have our android application which is running in kiosk mode. We would like to have feature to automatically check for updates, install those updates and run application again.
We can use some android service for that (actually, that's preferable way).
Do anybody has idea how we can accomplish that?
Thank you.
When the user has activated the auto update option in Play Store, then your update will automatically installed once the user has Wifi. If the user hasn't set this option you can do nothing about that.
You can ping your API every time your app starts, and your API has to tell you whether there is a new version. With this information you can display a popup to the user which forwards him to your PlayStore entry. But the user must select to update your app, you can not automate this process.
What you could do: If you write an HTML5 app, or you have a WebView which loads content from the network, then you can do your magic updates by simple updating the sources on server side.

How does downloading game updates works?

Let's say I published a game and after some point of time I wanted to release an all new feature for the game. Of course the app must be able recognize and download the update. How does this work specifically with Google Play apps? Does the app download the entire new version of APK from the market and reinstalls itself? I'm using Java for the development, if this info helps. Any tips you can give me about this topic?
With Google Play, the user is notified that app updates are available. It is up to the user to initiate the download of the updates.
You can always include in your app a check to your server as to whether an update is available. However, this becomes a maintenance issue.

Categories

Resources