android-hardware

Get Android Phone Model programmatically

馋奶兔 提交于 2019-12-16 20:14:17
问题 I would like to know if there is a way for reading the Phone Model programmatically in Android. I would like to get a string like HTC Dream, Milestone, Sapphire or whatever... 回答1: On many popular devices the market name of the device is not available. For example, on the Samsung Galaxy S6 the value of Build.MODEL could be "SM-G920F" , "SM-G920I" , or "SM-G920W8" . I created a small library that gets the market (consumer friendly) name of a device. It gets the correct name for over 10,000

Android library/API for NFC reader/writers

醉酒当歌 提交于 2019-12-13 14:11:31
问题 Are there any existing libraries that will allow an Android tablet (4.0.4) without a NFC chip to interface with an external USB NFC reader/writer? 回答1: Yes, the ACR 122 U can be connected via an USB OTG Cable. ACR has an Android test app on their driver page. You will in addition need something like NFC Tools for Java to interact with the reader (sending commands etc). 回答2: Maybe default packages will help you. Otherwise you can look for any third-party libs http://developer.android.com

Set mouse position in software

僤鯓⒐⒋嵵緔 提交于 2019-12-12 07:52:35
问题 I am using an Android Stick (http://www.geekbuying.com/item/Uhost-2-Dual-Core-TV-Box-Mini-PC-Android-4-0-4-RK3066-Cortex-A9-1-6GHZ-1GB-RAM-4G-ROM-with-Bluetooth-WIFI-Skype-XBMC---Black-312467.html) for building an application. The application uses an attached USB webcam for some of it's functionality. Additionally, I connect a mouse to this device which the user can use to navigate through various pages in the application. A left/right movement of the mouse results in navigation to previous

Hardware menu button not opening in Samsung galaxy tab 3

霸气de小男生 提交于 2019-12-11 07:19:17
问题 I have a samsung galaxy tab3 and I have the menu implemented in the usual manner - i.e. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.game_menu, menu); return true; } and for menu selected @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch (item.getItemId()) { case R.id.new_game: newGame(); return true; case R.id.help: showHelp(); return true; default: return super

How to clear count badge after clearing data and uninstall application in android?

痞子三分冷 提交于 2019-12-11 03:17:00
问题 The problem is when I install application and use it, it shows count badge on application icon. Now when I un-install application (while count badge is being displayed on application icon), and re-install the application, it again shows badge count on application icon. (Note:- It iss showing last badge count when application was un-installed) My problem is : Why badge count is being displayed after re-installing application? Do un-installing an application not clear its whole data? Can I

Disable hardware keys android rom

微笑、不失礼 提交于 2019-12-10 04:23:02
问题 I want to disable the Home, Menu and Back button in my custom AOSP rom. I´ve seached on the internet, and saw i can disable buttons after a succesfull build in the key layout files found in out/target/product/generic/system/usr/keylayout. The file i´m editing is: Generic.kl Now i´ve commented out these buttons: # key 139 MENU WAKE_DROPPED # key 158 BACK WAKE_DROPPED # key 172 HOME Then i restarted the emulator, and the buttons still work... Is there something i am missing? Thanks, Stefan 回答1:

How to disable all hardware keys programatically in android?

妖精的绣舞 提交于 2019-12-08 05:48:27
I am developing android application with lock functionality. please suggest me how to disable all the hard keys programatically. here i am using beleow code to disable back button. i want like this functionality for all hard keys like home,search,camera, shortcut keys here is my code: @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_SEARCH) { Log.d("KeyPress", "search"); return true; } return false; } Thanks in advance. Modify your onKey method to this : @Override public boolean onKey(View v, int keyCode, KeyEvent event) { return true; }

Retrieve Android Device Manufactured date Programmatically?

独自空忆成欢 提交于 2019-12-07 08:27:22
问题 I need to find the Android Device manufactured Date through my code I have gone through the android.os.Build API But Didn't find such a method is possible to get Android Device Manufactured Date or Not? 回答1: You can use Log.i("ManuFacturer :", Build.MANUFACTURER); Log.i("Board : ", Build.BOARD); Log.i("Diaply : ", Build.DISPLAY); Here is the documentations of that: http://developer.android.com/reference/android/os/Build.html 回答2: You can get the date the OS was installed. Date osInstalledDate

Phone light Turn On when incoming call come

荒凉一梦 提交于 2019-12-06 11:32:11
问题 I got incoming call and working well. But when my screen is turn off and an incoming call is come. Then my screen light is not on . I am using this code in onCreate():- getWindow().addFlags( WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED ); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag"); wl.acquire(); Also when my screen light ON and an

Android logcat logging only info level on real device. Cannot get debug messages, not even unhandled exceptions

旧巷老猫 提交于 2019-12-06 00:29:48
问题 I am developing for android for some time, and so far I didnt have any problem with logcat. Until now, i have new phone for development, Huawei Y300 (Y300-0100) and in logcat there is no messages from DEBUG level. This is problem, because I don't get Exceptions stack trace prints. I have to use emulator for that, you understand that it is annoying.. So far i figured out this: from: Log.v("TEST VERBOSE", "verbose level"); Log.d("TEST DEBUG", "debug level"); Log.i("TEST INFO", "info level");