Android checking network operator upon installation - android

I am building an android app, which is restricted to users only using a particular telecom network. And i don't want users who are not on that network to be able to install the app.
So i wanted to know if it is possible to check on which network operator the user is when installing the app.
Thanks.

No. The app cannot run any code while it is installing, or, before installation. Any code will be executed after the app is installed.
What you can do is, after the app is installed, check for network operator. If it is the desired one, let the user use the app. Else, deny any further access.
You can also ask the user to uninstall the app by creating a new Intent with Intent.ACTION_DELETE and specifying the package name. It will give the user an option to uninstall the app.

Related

Device Pin before installing APK

My use case is, My app should verify the device pin/password is set. if not then enforce the user to set it up. This has to be performed every time user launches my application and proceed after verification of the pin/password. Can some please help how to implement this. I am using apache cordova and jquery for my application development.
This would be plausible if there were, say, a manifest permission you could add since Android checks the permissions before installing the app, but there isn't that option... Personally, I wouldn't enter my phones "master password" into an app. Too sketchy. Your best option is to create your own password system handled by your app. So whenever the app is run (or whatever your specific need is) you can ask the user to input his password.

Need to find out, an application has installed already on the same device?

I need to implement trial period on my application. Once trial period is over,If user tries to uninstall and install the application again, for this case I had write one file on sdcard, if the user re install the application. When they open the application I had shown activation key prompt.
If the user delete the file,they can re install and use the application normally. How to solve this case. Is there any other way to hold the application install details in android device.
Note:
My application is a offline application.It won't need to connect with internet.(So there is no way to register with server).
Take of it this way. Everything you store on your phone will be able to get edited/removed/added. The best approach to this kind of problems is to use a webservice to register a device and check it's register date. However since your application is offline there is no way to do it foolproof.

Android - user permission for contacts and location info

By default, my android app which I am developing needs the location and the phonebook of the user who installs the app. The counterpart iPhone app pops up with the dialog and ask for user authorization to use both the address and the location info. Whereas, in Android I am not seeing any pop up or restriction in both the simulator as well in the actual physical device in which I am testing.
Can I safely presume that all apps once installed in the android environment will be granted both the location and phone book contact details. Please let me know. If not, is there a way of setting the permission through code or prompt the user for authorization in android?
Thanks for your time and help.
On Android, permissions like these are presented to the user at install time and they must accept them all to continue with the installation so yes.
According to the Android documentation:
The permissions required by an application are declared statically in that application, so they can be known up-front at install time and will not change after that.

How to prevent a user from installing applications which uses some specific permissions

What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Write your own firmware, where you replace the normal installer mechanism with one that enforces your desired criteria.
Android SDK applications cannot interfere with application installation.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
No, sorry.
However, you can listen for ACTION_PACKAGE_ADDED and examine the newly-installed package via PackageManager, and alert the user at that point. Since nothing of the installed package can run immediately upon the install, I would think that there is a decent chance that your alert will appear before the user tries to use the newly-installed app.
In the future this would be probably something you could do trough Device Administration, but right now limiting application installation based on its requested permission is not included.
One option is this snippet that decompress the apk and extracts the AndroidManifest.xml.
By the way the aapt tool for android runs on the Android OS too. You can get this information using this port

How to install multiple apks at a time?

Am developing one Android application which is using thinkfreeoffice.apk for viewing documents in my application. My requirement is I have to download both my application and thinkfreeoffice apks at a time and also install both these apks at a time.
anybody did this one before?
You cannot literally, unless your application is signed with the system certificate or you are using the SDK/ADB install method from a connected PC, or you find and abuse some security bug. As a security measure, any installation done by a normal application on the phone will require the user to go through the confirmation dialog one app at a time.
What you can do is put check in your application for the one it depends on, and keep complaining/downloading/ACTION_VIEWing the downloaded package upon startup of your app until the user either decides they don't want to use your app or agrees with the system install dialogue for the app you depend on.
I think it's impossible to install multiple applications at the same time, as the user has to confirm installation for each apk.
You could of course make the user install your application first, then ask the user to install the office application after which you use an intent to start the installation or redirect them to the Market.
Similar implementations have been used in applications that use third party barcode scanning or speech recognition.

Categories

Resources