How to Get IMEI on Android 5 in firemonkey?

I try to get IMEI on android device and i can do this on android 4.2 successfully

but my written code does not work on android 5 and later

how do get IMEI on android 5 in firemonkey?

-------------Problems Reply------------

Here is a code snippet which gets the Android device IMEI for you using the Android JNI :

uses
Androidapi.JNI.Telephony, Androidapi.JNI.Provider ,
Androidapi.JNIBridge, Androidapi.JNI.GraphicsContentViewText ,
Androidapi.JNI.JavaTypes,FMX.Helpers.Android;

event :

procedure TForm1.btnCapturarIMEIClick(Sender: TObject);
var
obj: JObject;
tm: JTelephonyManager;
IMEI: String;
begin
obj := SharedActivityContext.getSystemService(TJContext.JavaClass.TELEPHONY_SERVICE);
if obj <> nil then
begin
tm := TJTelephonyManager.Wrap( (obj as ILocalObject).GetObjectID );
if tm <> nil then
IMEI := JStringToString(tm.getDeviceId);
end;
if IMEI = '' then
IMEI := JStringToString(TJSettings_Secure.JavaClass.getString( SharedActivity.getContentResolver, TJSettings_Secure.JavaClass.ANDROID_ID));

ShowMessage('IMEI :' + #13 + IMEI);

end;

Category:android Views:15 Time:2018-12-19

Related post

  • How to get IMEI, LAC/CELLID in android 2011-05-30

    how to get IMEI, data of LAC/CELLID? Is it easy? in android/iphone? Could you please drop me few lines? --------------Solutions------------- For IMEI does it TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String

  • How to get IMEI on iPhone? 2009-05-05

    I want to get IMEI on iPhone. I try to use the following code: #import "Message/NetworkController.h" NetworkController *ntc=[[NetworkController sharedInstance] autorelease]; NSString *imeistring = [ntc IMEI]; But NetworkController is not found. I als

  • How to get IMEI number from iPhone programmatically? 2010-08-31

    Possible Duplicate: How to get IMEI on iPhone? I can get the UDID number but I want to get IMEI number...Is the apple dont allow to trace? If so where i can find the document of apple? --------------Solutions------------- NSString *imei = [[NetworkCo

  • how to get ContactsLaunchActivity in android? 2011-04-20

    create a new AVD (2.1) version. start it. and now, click to contacts icon -- you will get similar kinda screen as described below. Now my requirement is to catch up with the same screen and flow of android functions after certain click event on a but

  • How to get altitude in Android 2011-09-29

    I use the Location class to get altitude, but it always returns 0. Please tell me how to get altitude? Location.getAltitude(); --------------Solutions------------- Altitude is typically only available with GPS provider. You can check with available l

  • How to get IMEI number in phonegap? 2012-01-05

    i'm developing a phonegap android mobile application using jquery,javascript and html. I want to get the mobile IMEI .I have tried this code from this Tutorial. I am getting the number(97734a345d234d)like this.I have checked my device to get imei num

  • How to get IMEI number from a Windows mobile in java 2012-01-20

    Is it possible to get the IMEI number of windows mobile in java. If so can u please tell me the how it is possible. Is there any way to get IMEI number from System.getProperty("") method. If not is there any other way to achieve this? I had used Syst

  • How to get RTSP Links Android 2011-06-29

    Am having you-tube links like http://www.youtube.com/v/YR71GnQ4CU4?f=videos&app=youtube_gdata , then how to convert it to RTSP format to play in VideoView. Am searching gdata api with this: http://gdata.youtube.com/feeds/api/videos?&max-resul

  • How to get imei on iPhone 4S? 2011-11-07

    I need to get imei on iPhones. I use https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m to get IMEI. It works fine on iphone 4, 3GS ... even with ios5. But with iPhone 4S, imei is empty. Does somebody have a solution ?

  • How to get IMEI on iPhone 5 2013-05-21

    I'm develop application for jailbroken iOS devices. I use https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m to get IMEI, but on iPhone 5 this solution does not work(return empty string). Is there any way to get IMEI o

  • PHP: How to get version from android .apk file? 2010-06-10

    I am trying to create a PHP script to get the app version from Android APK file. Extracting XML file from the APK (zip) file and then parsing XML is one way, but I guess it should be simpler. Something like PHP Manual, example #3. Any ideas how to cr

  • how to get the device(android) tel number or other device unique id which can be taken from the system 2010-07-02

    I want to enter an website using the tel num as a password how do i get it using the android API is it possible ? or is there another key value on the android which is unique and I can ask him from the android system , android devices and therefore s

  • How to get information about android battery usage by application 2010-09-22

    How can I get battery usage per application in Android. I need to know % of battery spent by application. Is it possible using SDK? What I need is the information that's available on an Android device under "Settings>About phone>Battery use", b

  • How to get orientation of android from gyrsocope sensor events? 2011-03-13

    I am using android 2.3 on Nexus S and want to get orientation from gyroscope sensor events. As gyro gives angular velocity how to use this for getting device orientation ? Also is there any way we can get pure linear accelerations on phone's axis, wi

  • How to get shadow on android linear layout? 2011-04-02

    Possible Duplicate: how to set shadow to a View in android? In my Android app I need a layout with round corners and the background should have some transparency. For this I'm using this xml, it works fine: customshape.xml: <shape android:shape="r

  • How to get params from android.intent.action.SEND 2011-06-03

    I have registered my activity in the manifest as android.intent.action.SEND. Now, after pressing SHARE on every app, my application pops - which is great, but I didn't understand how do I fetch the parameters the other app sent to me? Thanks --------

  • How to get pid of android application with out using adb shell? 2011-09-17

    how can i get android application pid with out using adb shell.is there any api to get pid . any help will be appreciated --------------Solutions------------- As every application has its own process id, one can get it by int id= android.os.Process.m

  • How to get Direction in Android (Such as North, West) 2011-11-29

    I am new in Android and i want to get direction according to my camera. How can i get direction information according to my camera? Could you give an idea for this? Regards. --------------Solutions------------- Not sure what you mean by according to

  • How to get contacts in Android 2012-01-07

    I am a developing an application for composing sms in android platform. For that i need to get "Contacts", "Recent Contacts" and "Groups". Please tell me any tutorial or the code of how to do it. When we click on any of these three buttons there shou

  • How to Get JSONObject Only Android 2013-03-10

    {"StatusID":"1","Error":"Register Successfull."} This my JSONObject I don't know how to convert it to string in android Advice me Please Thank. --------------Solutions------------- Get the JSON object and get values like this. JSONObject jsonObject =

  • How to get IMEI number of a data card 2009-06-30

    I have one vodaphone data card with SIM embeded in that. there is IMEI number printed on datacard i wanted to know is there any way to read the IMEI number of that data card programatically. I am using datacard for browsing. and also i wanted to know

  • how to get path of android galley folder dynamically? 2010-10-22

    i want to get android camera gallery folder path to save images in that in different mobile phones it is different for example in galaxy it is /sdcard/DCIM/camera/image.jpg and in other phones for example /sdcard/media/images/image.jpg hot get path u

  • How to get rss feeds android? 2010-10-29

    I have this url here: http://www.webpronews.com/feeds Now i need to get the feeds and display it in android. Any clue? --------------Solutions------------- I use the lib xmlpull_1_1_3_4c.jar and for example read twitter feeds (rss) like below. XML Pu

  • how to get skype from android market place 2010-11-25

    i have an android emulator installed that has an android market app on its emulator..i have installed many apps from that,i want to download skype app from over there but there is no app by name skype at all... plz anyone help me out.. --------------

  • How to get screenshot with Android phone bezel in Eclipse AVD? 2011-03-08

    I have an Android presentation coming up and would like to get some screenshots of my application. Thing is, I'd like to have a screenshot of the phone with the app running on it. I could use a camera and take a pic of a droid phone+app, but seems to

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.099 (s). 11 q(s)