How close can we programmatically get to the hardware of an Android device?

家住魔仙堡 提交于 2019-12-11 12:55:30

问题


the camera of my mobile (running Eclair-update1) keeps being non-responsive in 90% of the time, so I assumed a hardware defect at first. After whiping the cache and the phone user data sereval times it worked again. At least for a while. Now it stopped working again.

Browsing the net I found quite some users who experience the same problem and had a hard time after whiping their user data off the device.

So my question would be: how close can I get to the hardware with the SDK? I'd like to write an app to influence hardware states (e.g. re-initializing the camera, remounting the SDcard aso.), but I'd prefer doing it - if possible - with the SDK instead of NDK.

Thanks in advance!
S.


回答1:


It's not a question of sdk vs. ndk, but of underlying operating system level permissions preventing ordinary (aftermarket vs. manufacturer/carrier installed) android applications in general from doing raw hardware access.




回答2:


  • Download Android SDK to your computer
  • Boot device to recovery
  • Connect USB cable to PC
  • Run adb shell then
  • umount /data
  • umount /system
  • e2fsck -fv /dev/block/stl9
  • e2fsck -fv /dev/block/stl10

Taken from forum.xda-developers.com/showthread.php?t=1396366



来源:https://stackoverflow.com/questions/4133874/how-close-can-we-programmatically-get-to-the-hardware-of-an-android-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!