Android : Programmatically Factory Reset? - android

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.

Related

How to check if the android device is rooted or not in Appcelerator?

I am looking for the solution in Appcelerator, to check that the android device is rooted or not through coding or programming.
I am not able to find the way in Appcelerator to achieve this.
if anybody has done this please help to find out how achieve this.
i have found few solution for android native but how to make it possible in android Appcelerator
Determining if an Android device is rooted programatically?
how to find the rooted device programmatically?
Have a look at these two modules:
https://github.com/collinprice/com.collinprice.rooted
https://github.com/appersonlabs/RootFinder
you can use http://gitt.io to search for modules (e.g. you'll find those two when searching for "root" on gitTio)
You need to understand that the process of rooting the device is changing with time and is getting more and more smarter. Nonetheless we still can try to perform some basic checks to filter out a portion of it.
Instead of doing it from Appcelerator, create an Android module and do the following:
Try to execute the su command, Runtime.getRuntime().exec("/system/xbin/which su"); Also check for the same su command in bin too (/system/bin/which su).
If it returns a success, you know for sure that the device is rooted. But you need to be aware that these are not the foolproof way, but only one of the ways to test and filter out.
install root checker on android device
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0ahUKEwj1zsWc2vvKAhWB1BoKHXpQBA8QFggqMAM&url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.joeykrim.rootcheck%26hl%3Den&usg=AFQjCNF5xeTKc4cWmWLWFs1WM19ABwlwhA&sig2=acMCp9r58lUvQHNqGQDk9A&bvm=bv.114195076,d.d2s

Android- detect any offline language dictionaries are installed

First of all,thanks to everyone, who considers this post.How to detect whether any of the offline language dictionaries,say https://play.google.com/store/apps/details?id=com.socialnmobile.colordict&feature=nav_result#?t=W251bGwsMSwyLDNd, https://play.google.com/store/apps/details?id=livio.pack.lang.en_US&feature=search_result#?t=W251bGwsMSwxLDEsImxpdmlvLnBhY2subGFuZy5lbl9VUyJd etc.., are installed in android device and if yes, how can I pass the word(for which the definition is required) programatically to the dictionary application.Please help me.
Finally , I prefer a solution for my question, though cant be the exact solution for the question.I used the link, http://thesaurus.altervista.org/dictionary-android
and used the available package and accessed from my application by using intent.
try this-
http://sourceforge.net/p/dictionarymid/code/HEAD/tree/trunk/Android/
might be it will be useful for you,good luck

Mtp-Host Application

Is there any application available in Android Market that used USB/MTP Api's?
tell any information that will be useful for me in making android MTP Application?
I think this might help:
Honeycomb-MTP-sample
It's a sample application that uses MTP to read camera contents.
I think camerabrower also gives you something about MTP/HOST.

Android screenshot - How to?

Is there any neat way of accessing screenshot of android device
programatically. I am looking for some 15-20fps.
I found one code
android\generic\frameworks\base\services\surfaceflinger\tests\screencap\scr eencap.cpp,
i built the executable and put it in /data and changed the mode 777
but when i tried to execute it using adb shell it gives the below error.
# chmod 777 test-screencap
chmod 777 test-screencap
# ./test-screencap test
./test-screencap test
screen capture failed: Function not implemented
I also know that we can access fb0 but its not a right method as suggested
by android team. Is it possible to access the screen shot at the frameworks
layer. I beleive surface flinger composes individual layers and gives it to
framebuffer.Where exactly this is done ? Can a application be able to access
such codes.
There are some java apps also which use ddms to actually capture this
framebuffer data without root access. But the fps is really poor.
I beleive there should be some or the other way of doing the above job.
Please suggest me some neat way of doing it. Suggestions are welcome.
What you are trying to do is not possible if you don't have a rooted phone, there is an app out there that does what you are trying, Screenshot ER. The latest OEM's are putting it into their /system/apps now... so you may be able to use their apps, check out this article for devices that have enabled this feature. Other than that your really stuck but there are implications with screen captures enabled as this could lead apps saving screen captures and sending that info out, enabling virus type apps...
Information for others .....Through Eclipse you can get a screen capture usig the DDMS perspective. If you take a look at the Eclipse DDMS code base its actually a stand-alone app too. You might be able to use this Java code then.
AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this);
Take a look at droid VNC Server
This is an open source project which you can clone the source code to your private PC. (http://github.com/oNaiPs/droid-VNC-server). I am investigating how VNC can do but It's really hard to do the same.
Read framebuffer content is an good solution also. But it just work with android <3.x only. I don't know how to fix it to work on android 4.x. If you know how (after see my suggestion) please share it here. Through my researching, I see that there are a lot of people looking for this.
Hope this helps.
nguyenminhbinh1602#gmail.com.
Android Freelancer.

Need to get specific SW information from Android phone in app

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.

Categories

Resources