Imposing Restrictions on the installation of apk - android

I want to make certain restrictions on distribution of the Android mobile application(apk).
I am currently not uploading the apk to Android market.
I want to provide the apk to the user with the following restrictions.
i> After the Android mobile application(apk) is installed , the application should work for only 5 days.
ii> The apk file cant be reinstalled on the same mobile device more than once.
Is there any way using code by which , I can make the above restrictions?
Kindly provide your suggestions/hints for implementing the same.
Warm Regards,
CB

Anything that you store on the device itself will be removed once the app is uninstalled, so you cannot check for a previous installation. You could hide something away on the SD card, you then cannot legislate for the user wiping their SD card, or swapping SD cards.
I would suggest registering a unique ID for the app installation with a simple web service. You can then interrogate this web service periodically to determine whether the 5 day limit has expired. Even if the user uninstalls and reinstalls the app, 5 day restriction will still be applied.

I think there should be an API which provides you the date when the apk is installed on the device, later we can compare that installation date to the current date and calculate if 5 days have occured or not. this may solve the problem. Sorry but I'm not aware of any such API's to get the installation date, but if the API is found then your problem can be solved. I just suggested a method of doing it. Let me also know if it has worked.

Related

How to update an already distributed app without installing a new version

I built a small application that gives real time update on coronavirus cases in my country.
Just recently, the API which I used to get the number of cases, deaths etc changed their endpoints
e.g from
https://covid19.com/corona/country
to
https://covid19.com/v2/corona/country
Due to strict restictions by Google on apps relating to covid19, I couldnt upload to playstore but I built an APK and shared the link to many people to download.
Now, they cant access the number of cases in the app due to a change in the API endpoints.
Please, how do I change just that string URL from my end to have effect on everyone who has the app already without needing to build another apk and making people to download the app again.
I discovered Firebase Remote Config, I tried it on my android studio, run the app on my phone, and yes it was working on my device, but How do I get it to work on other people devices with the app already installed.??
The only option you have is:
If you have put any text field which takes string data dynamically (like from database/server), there you can inform user to download latest version with a short link. But again that depends upon the text view size/scope you have defined.
Since, without updating the app itself by anyway, it seems impossible to make the existing app working.

Is there a way for Calabash to load an app that needs to be tested onto a phone that comes from a carrier that has the app pre-installed?

For business reasons, I cannot indulge the carrier or the app, but I need to test our app on phones that already have our app pre-installed. I have no problems running my scripts on phones that do not come pre-installed with this app, only the ones with it. The reason I believe is possibly because of the location of where the app is installed versus the location in which Calabash installs to. I thought if I rooted an Android phone that had our app on it that this would solve the problem, but that's not the case since the app does not appear on the phone after being rooted. Any suggestions would be appreciated and I apologize for the question being somewhat vague as I have to protect the companies involved. Thanks for understanding.
To add a little more detail so it makes more sense, this app I'm testing has already been released and because it's pre-loaded on this carrier's phones, I need to be able to get permission to uninstall and then reinstall the app. Maybe it's not possible but without getting some input I won't really know. Again, I have no problem testing on our older test phones (before the carrier began pre-loading the app) and maybe I need to just stick with testing on that for now. The problem with this is that it limits me from being able to test on the latest OS's. Thanks again for any input.
Whenever you want to update an app on the play store or publish a newer version first of all the package name of the app should be same and then the version code should be incremented and it should be more than that of the old version published.
In case the preload apk cannot be uninstalled (some preload app can also be uninstalled), and you do not have the same sign key for the preload apk, the answer would probably be impossible.
If you have the sign key of the preload apk, just resign the target-app apk and test-server apk.

Install Apk only once [duplicate]

This question already has an answer here:
To protect the apk
(1 answer)
Closed 9 years ago.
I want to make my android app apk to be install only once and it should not run on other device if it is copied from first device.Is it possible to do this in android?
Thanks in advance.
No, it is not possible. Apps can be installed and removed as many times the users want them to. Also our code comes into control only after our application gets installed. Hence we cannot determine whether we are getting installed or removed.
You don't have any way to do that if you want your user to be able to install the application
A possible workaround would be to test the DeviceID, and allow the app to proceed only if the DeviceID has been authorized.
Obviously you would have to manage this in your code, and that could become quite cumbersome if you need to authorize numerous devices. Plus I am not sure every device has a DeviceID
see Is there a unique Android device ID? for more information about this
and even take a look at licensing
Its not possible in android ,By using application signature you can't install same signature app if a same signature app is already there.but you can't restrict it to getting installed in other devices.
Just think about it. The application doesn't know whether it is installed already or not.
If you are using an web based application, then assign a value to the database after the installation. (This value should only be known by the device inserting the value at database)
So when your application open next time on another device check the value and prohibit the user. This is the way you can block it.

Creating A time Bound Trial Version Of an Android App

I have seen so many threads on creating a time bound trial versions for an android apps but none of them seems to fulfill my purpose.
Few days back i Launched the paid version of my app and now I want to come up with trial version which i dont want to be crippled from any side. So i want to have a time bound limitation on the trial version. I have created a different Package name for the same. Earlier I was using LVL and now also I am using the same except that i created new license library and changed the
setValidityTimestamp(extras.get("VT"));
to
setValidityTimestamp(String.valueOf(System.currentTimeMillis() + (5* MILLIS_PER_MINUTE))); in ServerManagedPolicy.
so that i can test if trial version works for 5 mins and then give me the license error. I published it on the app store , downloaded it and then found that it was still working beyond 5 mins. Now i have unpublished it. Can someone help me in creating the better time bound application which a user can run for a week (say). Besides he should not be able to uninstall and re-install it and then again use it permanently. I know if i can write the info to some external file but again the file can be deleted from sd card and application can be made accesible to the user free for lifetime.
Regards
Pankaj
Within the current capabilities of LVL, and the degree of user control over your average handset, there is currently NO way to do this without a server-side component. Once your app is uninstalled all traces (except, as you pointed out, files you may write to the SD card, which are user-visible) are removed, so the only way to check for an uninstall/re-install is to generate a consistent, device-specific identifier and check with a server component that will either reject this as a re-install or accept it as a new time trial. Even this can possibly be spoofed by a dedicated customer (depending on the server-side component behavior), so you would need to engineer your software so that your server-side component is a necessary part of the process (i.e. it isn't just a license check, it is actually part of the application's functionality).
If you come up with something that works I'd love to hear about it, but I'd say you're out of luck.
#Femi is right, you need a server side component to make always work. What I tend to do is publish only a free version, and teh user buys the full version as in-app-purchase. The IAP server is your server side check if the use purchased the upgrade or not. You can store a pref on first use to know when the user started using the app. If users uninstall and install again your app, they get a new trail period, but this is annoying, and few will do it to save a few bucks. If you add a message in the app where you ask user nicely to upgrade, or have ads that are removed once you upgrade, it is a good enough solution.

Demo Version of Application

What is the recommended way of creating a demo version for an application. Basically, the demo version will be fully functional, but will be limited to running it 25 times. My worry is that if the user uninstalls and reinstalls, the count will be reset.
I thought about writing a data file to the SD Card with the count of executions (hoping that would persist after uninstall), but I do not want to add that permission if I can avoid it.
Any suggestions on how to have some type of demo flag persist after an uninstall?
Even if it's on the SD card, there's no reason the user can't just go and delete your file themselves.
I asked a similar question a few months ago, but that was for a review copy, not a demo version. You could do something similar to what Dave Webb suggested and store each user's device id on a server. It would mean you'd both need the READ_PHONE_STATE and INTERNET permissions enabled and I can understand not wanting to add additional permissions. However, it is the only fool-proof way I can think of to guarantee that an application is only run X number of times, as any change you make to the phone can be reversed.
mbaird pointed out that anyone can install the full version of your app and try it for one day before requesting a refund; with this in mind you might make a crippled demo version that informs the user of this (not-oft-used) Market functionality.

Categories

Resources