android-hardware

Android: Get mobile hardware information

心已入冬 提交于 2019-12-02 07:01:05
问题 I am working on app which tells the user about Device. I go through many questions on SO but didn't find the answer. I want to find Model Number Android Version Base band Version Kernel Version Build number RAM of my Mobile. I would really appreciate any kind of help regarding this Thankx. 回答1: I was using this on my code, so I put all: Log.i("TAG", "SERIAL: " + Build.SERIAL); Log.i("TAG","MODEL: " + Build.MODEL); Log.i("TAG","ID: " + Build.ID); Log.i("TAG","Manufacture: " + Build

Android: Get mobile hardware information

早过忘川 提交于 2019-12-02 04:36:39
I am working on app which tells the user about Device. I go through many questions on SO but didn't find the answer. I want to find Model Number Android Version Base band Version Kernel Version Build number RAM of my Mobile. I would really appreciate any kind of help regarding this Thankx. I was using this on my code, so I put all: Log.i("TAG", "SERIAL: " + Build.SERIAL); Log.i("TAG","MODEL: " + Build.MODEL); Log.i("TAG","ID: " + Build.ID); Log.i("TAG","Manufacture: " + Build.MANUFACTURER); Log.i("TAG","brand: " + Build.BRAND); Log.i("TAG","type: " + Build.TYPE); Log.i("TAG","user: " + Build

can android os capture Bluetooth Mouse right-click and wheel event?

风流意气都作罢 提交于 2019-12-01 09:20:02
问题 I have an andriod 2.3.5 phone,it can connect to a bluetooth mouse. But I find it only response to left-click and mouse-move. if (event.getAction() == MotionEvent.ACTION_DOWN) {//Left Button } else if (event.getAction() == MotionEvent.ACTION_UP) {//Left Button } else if (event.getAction() == MotionEvent.ACTION_MOVE) { } What are the other action codes,such as Right Button,Wheel? thanks 回答1: Apparently API level you're using (10) still doesn't have any way of discerning between one mouse button

Android accelerometer max values

早过忘川 提交于 2019-11-30 21:39:48
So I have been searching for about 3 hours and I have not come up with a good answer/solution. My Question is: Why am I getting a max acceleration value of only about 34 m/s^2 or about 3.5 Gs (34/9.81). Is it because hardware restrictions or software restrictions? If it is hardware I know I can't do nothing about it(or at least not easily). If it is software restriction then how can I remove that restriction, is there any way of doing that? Like an API or something? I would appreciate any help, Thanks. Note : I am using a Galaxy S, if that makes a difference. I have also taking a look at this

Android accelerometer max values

偶尔善良 提交于 2019-11-30 17:17:28
问题 So I have been searching for about 3 hours and I have not come up with a good answer/solution. My Question is: Why am I getting a max acceleration value of only about 34 m/s^2 or about 3.5 Gs (34/9.81). Is it because hardware restrictions or software restrictions? If it is hardware I know I can't do nothing about it(or at least not easily). If it is software restriction then how can I remove that restriction, is there any way of doing that? Like an API or something? I would appreciate any

What is the android api for getting the list of connected audio devices?

梦想与她 提交于 2019-11-30 11:13:50
I used the below added code to get the connected audio devices for android device. Used AudioManager api method getDevices() and got the result with connected devices like earphones, speaker, headphones. But this getDevices() method is available since android api level 23 (Marshmallow) only. But my application should support from api level 21 (Lollipop). Please can anybody let me know the alternative api to get the available audio device for the android device. Code used with api level 23. AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); if (android.os.Build

What is the android api for getting the list of connected audio devices?

倾然丶 夕夏残阳落幕 提交于 2019-11-29 16:53:00
问题 I used the below added code to get the connected audio devices for android device. Used AudioManager api method getDevices() and got the result with connected devices like earphones, speaker, headphones. But this getDevices() method is available since android api level 23 (Marshmallow) only. But my application should support from api level 21 (Lollipop). Please can anybody let me know the alternative api to get the available audio device for the android device. Code used with api level 23.

How to stop the android soft keyboard from ever coming up in my entire application

半腔热情 提交于 2019-11-29 08:04:37
I'm developing an application on a hardware device that has a built-in hardware keyboard that does not slide out so is always visible (like a blackberry). Therefore, I NEVER want the soft keyboard to display for my entire application. I'm aware of another SO question that gives the following lines of code: InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); But I don't know where to put this code to hide the soft keyboard in all places where it might possibly appear in my Activity. I have

How can I launch an android app on upon pressing the volume up or volume down button?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 09:20:54
I have a requirements in a personal safety app where a user has to launch an app as soon as possible via pressing the volume up or volume down button. What is the procedure to add this functionality? molnarm There is no broadcast event for volume change. However, there is an undocumented action called " android.media.VOLUME_CHANGED_ACTION " which you could use, but it probably won't work on all devices/versions so it is not recommended . Using other buttons (e.g. media buttons ) would be possible though. EDIT: Code sample (using the undocumented action): AndroidManifest.xml ... <receiver

How to stop the android soft keyboard from ever coming up in my entire application

丶灬走出姿态 提交于 2019-11-28 01:42:43
问题 I'm developing an application on a hardware device that has a built-in hardware keyboard that does not slide out so is always visible (like a blackberry). Therefore, I NEVER want the soft keyboard to display for my entire application. I'm aware of another SO question that gives the following lines of code: InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); But I don't know where to put this