我曾尝试使用之前Google_Play_SERVICE/SAMPLE使用所有可用选项提供的Google地图示例代码,并显示以下日志.
01-14 17:58:39.773:E/Google Maps Android API(13114):授权失败.
它显示了所有示例Map选项的空白屏幕.
现在我创建了一个新项目,这里是完整的代码: -
Activity.java
public class MapActivity extends FragmentActivity
{
private Context context = this;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
GoogleMap gMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context);
Log.e("Maps", "Result int value::" + result);
switch (result) {
case ConnectionResult.SUCCESS:
Log.e("Maps", "RESULT:: SUCCESS");
break;
case ConnectionResult.DEVELOPER_ERROR:
Log.e("Maps", "RESULT:: DE");
break;
case ConnectionResult.INTERNAL_ERROR:
Log.e("Maps", "RESULT:: IE");
break;
case ConnectionResult.INVALID_ACCOUNT:
Log.e("Maps", "RESULT:: IA");
break;
case ConnectionResult.NETWORK_ERROR:
Log.e("Maps", "RESULT:: NE");
break;
case ConnectionResult.RESOLUTION_REQUIRED: …Run Code Online (Sandbox Code Playgroud) 我正在制作一个Android应用程序,我想在imageview中播放一个GIF文件.我尝试了很多方法,做了一个自定义类但没有成功.
有没有人以前实现过这个?
我能够以编程方式断开呼叫,以便在Android 2.2中调用未知号码.但在android 4.1中,它不起作用.
工作代码断开Android 2.2中的调用:
private Class c;
private Method m;
private com.android.internal.telephony.ITelephony telephonyService;
public void onReceive(Context context, Intent intent)
{
Bundle b = intent.getExtras();
String state = b.getString(TelephonyManager.EXTRA_STATE);
if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING))
{
TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
c = Class.forName(tm.getClass().getName());
m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (ITelephony) m.invoke(tm);
telephonyService.silenceRinger();
telephonyService.endCall();
}
}
Run Code Online (Sandbox Code Playgroud)
请帮帮我.谢谢
最后我得到了2.6版本的解决方案.
MODIFY_PHONE_STATE自2.3+以来,权限不再适用于silenceRinger(),但endCall也没问题.因此解决方案是注释掉对silenceRinger()的调用.
我已经尝试了很多,但无法弄清楚如何生成iPhone设备MD5 hash的UDID代码.
原因:我必须使用该哈希作为后台密码才能登录网站.
请帮忙.
提前致谢.