Is there a way to get a device's unique identification using MIDP2.0?
I assume you need to get the IMEI number of the device.
According to the information I found there is no J2ME method to do that because the Hardware API is different from a one model to another. But the device manufacturers provide APIs to get the IMEI number.
Have a look on following article.
Get device ID
Related
I am able to retrieve contacts and all of their information, but in the Contact list I do not see "ME". I read that this was not supported, but t there was a ticket to Android about this (back in 2011?).
Is it possible to retrieve MY contact card in Android?
No, because you don't have one unless the user added one. Even if there is one, there's no promise of any actual data on it. Not even phone number, since its possible for a phone to not know its own phone number.
I attached the image to complete understanding of my question.
Image of Build Number of my android device
I have pointed out the build number of my android device.
Here is my 2 question.
1) Is it unique for every device or it can be same?
2) if it is unique how we can get it programmatically?
In order to uniquely identify a device you can use the Secure class in which is part of the Android's Settings package. which returns the Android ID as n unique 64-bit hex string. This way:
import android.provider.Settings.Secure;
private String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);
However, this is non to be null sometimes. An all perfect complete solution to uniquely identify a device is yet to come up. There are various factors to be considered while acquiring the unique id of a device. Also see this Answer
I'm developing an Android App and I need to be able to capture the SKU, Buyer Code and CSC of the device (only Samsung smartphones). I guess I only need the Buyer code (Country Code) and the CSC, but I've been searching and it looks like the SKU code already has these two codes.
I need these codes so I can restrict my App to some specific smartphones, specifically those that where bought in a specific country.
I can't find a way or a class that will help me get these information. I'm already capturing the device's IMEI and model, but not the Buyer Code or CSC.
I appreciate if someone can help me with this.
I found that post providing some Basic information.
How to obtain Firmware version of Android programmatically?
Some data like CSC are given by different ways depending on the manufacturer.
For Samsung for example, you will find information about software in /system/SW_Configuration.xml and about buyer in /system/csc/sales_code.dat and /efs/imei/mps_code.dat
I obtained the Android serial number by code using
android.os.Build.SERIAL
I then compare it to the serial number found in the Settings menu (Settings-> About device-> Status-> Serial number).
I've tested it, and it seems that on some devices (e.g. Nexus) the two codes are the same, while on others (e.g. Galaxy Note) the two codes are completely different: The Java code returns me a 16-digit alphanumeric (lowercase) code, while on screen I can see an 11-digit alphanumeric (uppercase) code.
How is it possible? Are these two codes the same, or something completely different?
If they are the same, is there a way to convert from one of the two to the other?
Is there a better way to identify the device? I know that I can useĀ
the phone device ID (IMEI, MEID,...), which can be obtained
TelephonyManager tManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
tManager.getDeviceId();
but not all devices are phones, and not all of them have this code;
The Android ID, retrievable by
Secure.getString(context.getContentResolver(),Secure.ANDROID_ID);
But I cannot find it anywhere in the Settings menu, and I need my user to tell me its code by reading it from the user interface.
The app "Android id" on google play(free) shows different ID's like:
android_ID
android.os.build.serial
telephonyManager deviceID
wifi mac
I want to know if I can rely on the telephony values like country, MCC, etc on Android for my app. Can I change them on the run using setprop? I tried changing using setprop it didn't seem to work. From my understanding telephony manager is a class/interface which represents Hardware configuration of GSM or CDMA. In case of GSM this could be sim and in case of CDMA it cud be a hardware. My questions are:
Who update these values in both the cases for the first time?
Are these values are saved by OS as read only?
What if a user travels to different country or zone will some of the values like country code and MCC values updated automatically?
Can I reset these values?
I have no intention of changing any of these values but want to understand its working! I would appreciate if someone can help me on this.
According to android documentation
Provides access to information about the telephony services on the
device. Applications can use the methods in this class to determine
telephony services and states, as well as to access some types of
subscriber information. Applications can also register a listener to
receive notification of telephony state changes.
TelephonyManager is used for reading phone information. Regarding your question about MCC & MNC codes: yes, they will change when phone will be in other country. You can subscribe to receive those events and determine that user now in different country.
#Bo
The way CDMA works is different from GSM. CDMA has always got one home base and many visitor base location. and you can always get to know about visitor Operator using TelephonyManager methods which is considered as unreliable for CDMA.
I decided to add it as answer as well...
I found a way to tackle this problem on CDMA phone.. if it is a CDMA phone , then the phone always has an ICC hardware comparable to SIM cards in GSM. All you gotta do is use the system properties associated with the hard ware . Programmatically you can use Java reflection to get this information . This is not changeable even system is rooted unlike GSM device. Class c=Class.forName("android.os.SystemProperties"); Method get = c.getMethod("get", String.class); String homeOperator = ((String) get.invoke(c, "ro.cdma.home.operator.numeric"));