我们怎样才能执行Email Validation上edittext的android?我已经浏览了谷歌和SO,但我没有找到一种简单的方法来验证它.
如何获取用户在android中输入的位置/地址的gps坐标?
我试图获取设备的IP地址,即使用WIFI或3G连接.我收到了IPV6格式的IP地址,这是不可理解的.我想要IPV4格式的IP地址.我做了google但dint找到了任何合适的解决方案.
这是我用来获取设备IP地址的代码
public String getLocalIpAddress() {
try {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();)
{
InetAddress inetAddress = enumIpAddr.nextElement();
System.out.println("ip1--:" + inetAddress);
System.out.println("ip2--:" + inetAddress.getHostAddress());
if (!inetAddress.isLoopbackAddress()) {
String ip = inetAddress.getHostAddress().toString();
System.out.println("ip---::" + ip);
EditText tv = (EditText) findViewById(R.id.ipadd);
tv.setText(ip);
return inetAddress.getHostAddress().toString();
}
}
}
} catch (Exception ex) {
Log.e("IP Address", ex.toString());
}
return null;
}
Run Code Online (Sandbox Code Playgroud)
我得到这个输出:
ip1--:/fe80::5054:ff:fe12:3456%eth0%2
ip2--:fe80::5054:ff:fe12:3456%eth0
Run Code Online (Sandbox Code Playgroud)
它应该显示如下:
192.168.1.1
Run Code Online (Sandbox Code Playgroud)
请帮帮我..
android ip-address android-networking android-4.0-ice-cream-sandwich
如何为textview的某些部分提供自动链接?例如:我在TextView中的文本是"请单击此处打开此网页".我想仅显示"here"文本的链接.我应该打开该网页,单击"此处"文本,但不要在TextView的任何位置打开.请帮我.
如何获取MD5指纹密钥.
我正在使用此命令:
C:\Program Files\Java\jdk1.7.0_04\bin>keytool.exe -list -alias androiddebugkey -keystore "C:\Documents and Settings\IBM\.android\debug.keystore" -storepass android -keypass android `
Run Code Online (Sandbox Code Playgroud)
但无法获得MD5密钥,但我获得了证书指纹(SHA1)密钥
androiddebugkey, Jan 16, 2012, PrivateKeyEntry,Certificate fingerprint (SHA1):A4:9E:8F:FA:1A:B2:A0:79:3D:D3:95:41:82:3B:F6:DA:78:40:DD:DE
Run Code Online (Sandbox Code Playgroud)
我想要MD5认证密钥.
非常感谢.
我正在模拟器4.0.3,每当运行项目新的Android模拟器启动,以前的模拟器显示空白屏幕,即空闲屏幕无法正常工作.会有什么问题?我该如何解决?
重置adb时出错
[2012-05-11 16:54:11 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host
[2012-05-11 16:54:11 - Unexpected error while launching logcat. Try reselecting the device.] An existing connection was forcibly closed by the remote host
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:395)
at com.android.ddmlib.Device.executeShellCommand(Device.java:397)
at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:102)
at java.lang.Thread.run(Unknown Source)
[2012-05-11 16:54:12 - DeviceMonitor] Connection …Run Code Online (Sandbox Code Playgroud) 如何以编程方式在Android设备上检查该网络是否可用,当我们尝试连接Wifi和3G等网络时,会抛出消息或Toast消息.
我正在尝试通过服务器传输音频.我已经设置了所有内容,并且它可以正常录制和播放静态音频,但是当我尝试流式传输音频时,播放方面会有延迟.
我做了谷歌搜索,但找不到正确的方法.我正在使用AudioRecord和Audiotrack Android媒体API来发送和接收音频数据.谁能告诉我如何处理这种延迟?
我在GOOGLE GROUP上添加了我的代码以获得清晰的图片.
我试过这种方式,将5块音频数据保存在一个缓冲区中,该缓冲区通过服务器并在填充5块数据时播放并再次获取下5块音频数据并填充它直到1024字节数据(它写入录音带和播放方法被称为).这也有延迟,任何其他解决方案?
android audio-recording audio-streaming audio-player android-mediaplayer
我有像这样的xml布局main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center" >
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="text"
android:textColor="#000"
android:textSize="16dp"
android:id="@+id/edtxt"
android:gravity="center|top|left"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我在这样的活动中宣布这一点
public class MyActivity extends Activity {
private TextView txt = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txt= (TextView)findViewById(R.id.edtxt);
}
}
Run Code Online (Sandbox Code Playgroud)
但我的活动没有问题.为什么?
有些设备(如三星Galaxy S3)预先安装了由Vlingo驱动的三星,而不是谷歌语音搜索.
在我的应用程序中,我想以编程方式覆盖要使用的语音识别引擎,以便我的应用程序始终使用Google语音搜索.
所以我的问题是:
帮助将不胜感激
android ×10
textview ×2
3g ×1
android-4.0-ice-cream-sandwich ×1
audio-player ×1
autolink ×1
eclipse ×1
google-maps ×1
gps ×1
ip-address ×1
networking ×1
wifi ×1