Need to get specific SW information from Android phone in app - android

I am working on an app that will access different items in the phone status screen for work. I need to be able to get specific software information from the phone to populate in the app. For example: in the droid x, the system version shows as 4.5.605.MB810.Verizon.en.us . This is the software info I need to auto populate. I have tried all of the Build options from the android developer site and I have even tried the SYSTEM_VERSION string from telephony, but they all provide information other than what I need. Can anyone tell me how to reference this software information please?

Check out android.os.Build. Here are the details:
http://developer.android.com/reference/android/os/Build.html
And for OS version specifics, use the nested class Build.VERSION detailed here:
http://developer.android.com/reference/android/os/Build.VERSION.html

Check the Settings app code for where it gets its information.

Related

How can I discover CPU usage of my application in Android (programmatically)?

Is there any way to find out CPU usage of my Android application programmatically? I'm aware of this question already, but it is about Corona SDK.
Note that I want to do this on non-root devices.
Any help would be appreciated.
I am not sure about programmatically, but you can use Android profiler to achieve the same.
Run your application, either in a physical device or emulator (doesn't matter here)
When the application is running, you will see a Profile tab in the toolbar
If you don't see a Profile tab, you can access the same using Run > Profile 'app'
Edit
Check this answer
Edit 2
You can use firebase performance monitoring for runtime data collection about performance. Follow this link
I just found a way to calculate the CPU usage of a process by PID. According to the doc, the /proc/[pid]/stat file contains status information about the process. So we can parse this file to get the following members:
utime %lu
stime %lu
Check this page to get more information about the /proc/[pid]/stat file and the way to parse it.
Also here is a relevant question about utime and stime.

Get statistical informations about an Android device

I write an App and I'd like to get some informations about the Android devices my users are using.
I'd like to know
manufactor
the Android version
and some kind of unique ID
Is that possible without any special permissions? What is the API?
Take a look at the Build object. It will give you some details about the Android build.
Information about the Android version can be found in Build.VERSION
Hope that helps.
I'd like to know the manufactor, the Android version and some kind of
unique ID. Is that possible without any special permissions?
If you wrote 'permission' word in terms of manifest permission then you dont need any special permission for that , because its not something from user must be aware about application access of that data .
and if you would like to know about Build information then brianestey's answer is much clear to that .

Android : Programmatically Factory Reset?

I am having full access to Android system. I have all the super user permission to do all the things from any of my application. I just want to implement one functionality in which I need to reset the device without redirecting user to PRIVACY_SETTINGS. If anyone knows how to achieve that please share with me.
Its kind of urgent. Thanks in advance.
You can use device admin. http://developer.android.com/guide/topics/admin/device-admin.html It allows you to wipe all the data. There's a good sample in API demos.
Programmatically: https://stackoverflow.com/a/11885303/1257591
It shows two ways, one is the implementation mentioned by Mighter and an approach for older devices (android version < 2.2)
ADB: https://stackoverflow.com/a/10829600/1257591
Contains adb commands and an example. Judging from the tag of your question this might be the answer you are looking for.

How can I make sure that my Android app is only available on the Galaxy Tab?

I want to set up my Android app so that it can only be downloaded/installed on the Samsung Galaxy Tab. I've looked at guides like "Five Steps to Future Hardware Happiness," but I haven't gotten much out of them. The Galaxy-Tab-only requirement is from the client that I'm building this app for - specifically, he wants to target just the Galaxy Tab P-1000 model, not other Tabs.
How can I set up my app so that the Android Market knows it should only be available to this specific model of device?
android.os.Build contains properties you are interested in.
Build.MODEL, Build.PRODUCT and Build.MANUFACTURER should give you the info you need. They are all String objects.
And also, before installation u cant detect the device model, but after installing the app, you can detect the device model using Build.Model attribute and run ur application as accordingly..
You can do this on Google Play itself, by adding all devices except the one you wish to support to the "Manually Excluded" list of your store listing. More information is available here:
http://support.google.com/googleplay/android-developer/answer/1286017
I dont think you can detect the hardware manufacturer or the model type using standard android apis.

Spoofing Location

I've got an application in the browser that's customized to use Android's browser geolocation APIs. I'd like to find a way to fake the lat/lng that's sent to the browser so I can type in arbitrary coordinates.
In doing some research I came across DDMS - http://developer.android.com/guide/developing/tools/ddms.html - which seems to do what I want, but seems to require the IDE or an emulator. I don't want to use an emulator because I want to test on the device and I don't have the IDE set up for Android.
Does anyone know if there's a way to send mock location data to an Android device without loading up the IDE (or doing it through the emulator)?
I do not believe this is possible -- sorry!
Also the DDMS and IDE solutions are one and the same and only work with the emulator.
Just in case someone stumbles across this question like I did, here is some info about how to mock the LocationProvider on a physical device. Marking this as community wiki because I didn't come up with the original answer. Code is listed in diffract.me/2009/11/android-location-provider-mock (looks like domain is expired as of 9/29/2010, I used Google's cache of the page) & from stackoverflow.com/.../android-mock-location-on-device.

Categories

Resources