Discover ip address changer android, include the articles, news, trends, analysis and practical advice about ip address changer android on alibabacloud.com
There are a lot of people who are asking Android phones how to achieve phone voice changer? A lot of people say no, it is not possible to achieve the phone voice changer through the general method, because Android restricts the phone to replace the microphone when the telephone. So there's only one alternative. Recentl
Android implements ip address input for computer imitation, and android implements ip imitation
Recently, this demand has been changed to a special one. It is estimated that some people have encountered this disgusting requirement. The client needs to enter an
Android Get IP Address
Recently done project, there is a demand is the Android device to obtain the current IP function, after a query to solve the data, record the implementation method.
1. Using WiFi
Set user Permissions First
Second, the code is as follow
Android obtains the ip address and the physical address of the local machine.
/*** Get ip ** @ return */public static String getLocalIPAddress () {try {for (Enumeration
En = NetworkInterface. getNetworkInterfaces (); en. hasMoreElements ();) {NetworkInterface intf = en.
1. How to obtain the MAC address of a local machine from Android:
You need to add permissions to the androidmanifest. xml file:
public String getLocalMacAddress() { WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); return info.getMacAddress(); }
2. How to obtain the local
1. Get the phone IP address code:
public static String getlocalipaddress () {
try{for
(enumeration
But in 4.0 there will be a similar fe80::b607:f9ff:fee5:487e IP address, this is the address of IPV6, we need to get the
and forward the data."Simulator (5554)-server/Simulator (5556)-client"Purpose: The simulator (5556) is connected to the 7100 port of the simulator (5554).Implementation is also relatively complex. To do this, port mapping is also done first.Map the native port tcp/6100 to the emulator (5554) tcp/7100 port (UDP is the same).>adb–s emulator-5554 forward tcp:6100 tcp:7100After the port mapping is successful, proceed to the following experiment.Method 1 (correct):Simulator (5554)-server:serversocke
This article describes the Android implementation approach to acquiring wired and wireless IP addresses. Share to everyone for your reference. Specifically as follows:
To do the development of Android, encountered the problem of getting a wired IP address. Not much to say c
Android obtains the IP address of the device.
Overall retrieval: You can use mobile data to access the Internet and obtain IP addresses. You can also use WiFi to obtain IP addresses.
public static String getPhoneIp() { try { for (Enumeration
en = NetworkInt
Overall access can be mobile data on the Internet get IP also can WiFi access methodpublic static String Getphoneip () { try {for (enumerationWiFi Get IP methodPrivate String inttoip (int IP) {return (IP 0xFF) + "." + ((IP >> 8) 0xFF) + "." + ((
) + "." +
((I >> ) 0xFF) + "." +
(I >> 0xFF);
}
2. Using GPRSFirst, set the user's Internet access rights
uses-permission android:name="Android.permission.INTERNET">uses-permission >
Second, the code is as follows
Public String getlocalipaddress ()
{
Try
{
For (enumeration
{
NetworkInterface intf = En.nextelement ();
For (enumeration
{
InetAddress inetaddress = Enumipaddr.nextelement ();
if (!inetaddress.isloopbackaddress ())
{
return
Try { //get all the network devices on your phone (WiFi module)enumerationnetworkinterface.getnetworkinterfaces (); //Enumerate all network devices while(Netinterface.hasmoreelements ()) {NetworkInterface ni=netinterface.nextelement (); //gets the IP address that is bound to the current network deviceenumerationni.getinetaddresses (); while(Ips.hasmoreelements ()) {//Print the bound
1 Get IPV4 Addresspublicstringgetlocalipaddress () { Stringaddress= "0";try{ Enumeration 2 Get IPV6 address publicstringgetlocalipaddress () { Stringaddress= "0";try{ EnumerationThis article is from the "Jackyanngo" blog, make sure to keep this source http://jackyanngo.blog.51cto.com/5263823/1614612[Android] Get IP address
I. OverviewI am used to network programming in Linux. I have been wondering how to get the IP address of my mobile phone before I use a smartphone ). Okay, I know that Android is based on the Linux kernel. Can I use the network programming method in Linux I learned to get the IP ad
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.