Android Emulator change phone number unknown to number default - android

I want to get the phone number of the emulator, but when I check the phone number in setting-about phone-status, the phone number shows 'unknown'. Sometimes the pone number shows a number. How can I get the phone number of the android emulator. Thanks

Your emulator does not have a phone number. If you want to "call" it or "SMS" it here is how:
1. In eclipse open the DDMS perspective. (Upper-right corner, click the little new window button ->DDMS
2. On the left hand side under emulator control you should see a section called "Telephony Actions"
3. There you can enter your own phone number (this will be the incoming number) as well as call or even write an SMS (Check SMS and than compose in the box).
4. Hit send and you should see it come in on your emulator.
Hope this helps!

Related

Cast icon not showing for custom receiver

I have followed the CastHelloText-android example on github. When I use either the receiver they specified in the demo or the default receiver, the cast icon shows up in my application.
However, as soon as I change the app_id to be the one provided by the Google Cast SDK Developer Console for my registered application, the icon doesn't show.
I've tried rebooting my chromecast and my android device. All to no avail.
Any suggestions?
Make sure the serial number for the device that you have registered on the dev console is correct, it is sometimes hard to read the serial number (take a picture and zoom in). Also make sure the checkbox that sends the serial number is checked when you setup you chromecast. If cast icon doesn't show up for your own app-id but shows up for the other one, then there is an issue with your app/device registration.
I had the same issue as Kimble above. I started with the serial number on my Nvidia shield, which didn't work because that's not the serial number for the Chromecast. The proper serial number can be found in the settings menu under "Chromecast built-in".
I know I am late to the party, but here is a probably more up-to-date solution. Following this documentation solved my problem: https://developers.google.com/cast/docs/registration#find_device_serial_number
According to the documentation, for cast-enabled Android TVs, the serial number can be found in the following way:
Android TV (ATV) devices have multiple serial numbers associated with them. The software (Cast) serial number can be obtained either by casting the Cast Developer Console page to the ATV device as outlined above, or by putting the ATV device into developer mode and looking in the Cast settings for the software serial number.
To put your ATV device into developer mode, navigate to Settings > System > About > Android TV OS build, and click on the build several times until the device notifies you that you are in developer mode. To find the serial number once in developer mode, navigate either to Settings > Device Preferences > Chromecast built-in or Settings > System > Cast, depending on your ATV model, and you'll see the software serial number displayed.
Also, since just by looking at the screen there is no way to disambiguate zero and capital O, or small L and capital I, etc., you can simply cast the page in the link above to read out the serial number for you:
To find the serial number of any device, you can cast the Cast Developer Console page to the device:
Click the Cast button (as if you were casting this page).
The prompt displays Cast tab and lists the available devices.
From the drop-down menu, select the device for which you want to obtain the serial number.
For display devices, the serial number displays on the TV screen and is read aloud on the TV speakers (to help disambiguate 0's and O's).
For audio devices, the serial number is read aloud on the speaker being cast to.

How to set emulator phone number in my eclipse code file?

My code
I am not able to send and receive SMS between 2 emulators. Where and how can I add the emulator phone numbers in my codes to send text messages?
Just try to send the SMS to the AVD number. For example : 5554, thats all I do and its working.
The AVD number is on top of your AVD's window.
More source : Sending and receiving text using android emulator
And I've used this source when I was learning:
http://mobiforge.com/developing/story/sms-messaging-android

Android emulator: Set mobile device number?

Does anyone know if its possible to set the emulator's mobile number? I have not been able to find information about this anywhere. Thanks.
Mostly full control of the phone number detailed at the end of this blog:
http://blog.talosintel.com/2013/04/changing-imei-provider-model-and-phone.html
First 7 are fully configurable, last 4 can be one of 16 allowed port numbers.
It turns out that the phone number is stored on the SIM card. Since there is no actual SIM card, one is emulated. This emulated SIM is hard coded in the emulator-arm binary. The reason replacements for 1555521 failed is because SIM cards have a specification that does not store the MSISDN (Mobile Subscriber Integrated Services Digital Network-Number, AKA phone number) in plain text. Instead, each set of digits is swapped in some reverse nibbled endianness nightmare.
...
A quick way to find the MSISDN is to search for %d%df%d in the binary (highlighted in red below). The corresponding source code is in external/qemu/telephony/sim_card.c on line 436 in the current repo. The following is the format string portion of that sprintf:
"+CRSM:144,0,ffffffffffffffffffffffffffffffffffff0781515525%d1%d%df%dffffffffffff"
The interesting part is 515525%d1 (highlighted in blue). Swapping each set of two digits produces 1555521%d (thanks again CodePainters). That looks like the prefix to our mobile number.
Edit it in a hex editor.
I think this webpage will show you how to do it
https://www.wikihow.com/Find-Your-Phone-Number-on-Android
here instead of about phone try searching about the emulator device
You can simulate incoming SMS and calls in the simulator (using the simulator's port) but that's all, you can not set a device number or anything like that. For that kind of thing you will need a real device.
As I have found each emulator already has a phone number. If you run two emulators you can call from one emulator to another. To find out this phone numbers you can run in the terminal window:
Path\To\Your\Android\Sdk\platform-tools>adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
First phone number is +15555215554, second +15555215556, i.e. phone number is prefix +1555521 plus emulator suffix 5554 or 5556.
In your emulated device, press on the 3 dots highlighted in yellow and choose phone and then you can change the mobile number, screenshot attached in link below
https://i.stack.imgur.com/zhbSV.png
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
// get IMEI
String imei = tm.getDeviceId();
System.out.println("gfvnchgjvbnvhjbbnvgjvbncghvmn ngvm"+imei);
// get SimSerialNumber
String simSerialNumber = tm.getSimSerialNumber();
System.out.println("854755745588954754855ngvm"+simSerialNumber);
//get SimCardNumber
String number = tm.getLine1Number();
System.out.println("gfch5652345651szdxfcgvhbjnfcgvh ngvm"+number);
And Import :]->
import android.content.Context;
import android.telephony.TelephonyManager;
The mobile number of an emulator is the port number of that emulator. For more details. please check this link:
http://developer.android.com/guide/developing/devices/emulator.html#calling

Poll: Phone number in Android About -> Phone Identity and International Dialling Codes

Background; I am in the process of writing an Android messaging application that needs to know the current user's phone number. This is then used to connect to other users using the application.
My application relies on looking up the user's number from Android's Settings -> About Phone -> Phone identity -> Phone number (this can at times be blank.. but that is a separate problem).
I am assuming that the above Phone number contains the user's full number. ie, my UK Android phone shows my number as: +447832xxxxxxxx, where 44 is the UK's international dialling code and 7832 is the operator.
Is it safe to assume that all Androids phones would include the international dialling code, which starts with +?
I would be indebted if any Android users could have a quick look at their Android settings and confirm whether Phone number is displayed as +international code+operator+number, i.e. US Android sets start with +1xxxxxx.
TelephonyManager.getLine1Number() is not guaranteed to be correct or even available to applications. I'd suggest a backup plan of using SECURE_ID to match to some user entered, possibly text-message verified phone number on a server somewhere. But even SECURE_ID is sometimes not a unique identifier (all DROID2 phones have the same ID), which would mean you should rely on an account system of some sort.
In my phone (Nexus One, Android 2.2, O2 UK) I don't have Settings -> About Phone -> Phone identity. In Settings -> Status -> My phone number is "Unknown". Not sure this helps you though, sorry.
On my moto droid with 2.2 I have: Settings->About Phone->Status->My phone number. FYI it is not prefixed with +international code

Send an SMS to the emulator

I am working on an android application and I want to send an SMS to the phone number of the phone i.e the emulator. I know there will be no real phone number for emulator, but how can I send an SMS from the phone?
Open Eclipse. Select "Emulator Control" from Window -->Show View -->Android.There will be an option called Telephony Actions. There under the Incoming number just specify a sample number.Select SMS and type the text that you want and finally click "Send"
You can try this sample app too
http://samplecodeviewer.googlecode.com/svn-history/r2/trunk/SampleCodeViewer/SMSTest.zip
and check for SMSSender.java class.

Categories

Resources