Reference:
https://developers.google.com/maps/documentation/android-api/controls#toolbar
Code sinppet:
mMap.getUiSettings().setMapToolbarEnabled(false);
2016年1月25日 星期一
2016年1月11日 星期一
[Exception] couldn't find class 'com.google.android.gms.measurement.internal.zzz'
References:
http://stackoverflow.com/questions/33196015/error-on-some-devices-couldnt-find-class-com-google-android-gms-measurementError log:
01-12 14:45:58.910 4347-4347/? E/dalvikvm﹕ Could not find class 'com.google.android.gms.measurement.internal.zzx', referenced from method com.google.android.gms.measurement.internal.zzt.zzaUjava.lang.VerifyError: com/google/android/gms/measurement/internal/zzt
at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at android.app.ActivityThread.installProvider(ActivityThread.java:4897)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4487)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4427)
at android.app.ActivityThread.access$1500(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5124)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:613)
at dalvik.system.NativeStart.main(Native Method)
Code snippet:
MyApplication.javapublic class MyApplication extends Application {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
AndroidManifest.xml
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/xxxxxx"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
Solution:
This happens because of multi-dexing. When your code is so big that it can't be compiled with a single dex file, we use multidexing. But after that it wouldn't run on all phones2016年1月10日 星期日
Get application directory
Reference:
http://stackoverflow.com/questions/5527764/get-application-directoryCode snippet:
PackageManager m = getPackageManager();String s = getPackageName();
try {
PackageInfo p = m.getPackageInfo(s, 0);
s = p.applicationInfo.dataDir;
} catch (PackageManager.NameNotFoundException e) {
Log.w("yourtag", "Error Package name not found ", e);
}
2016年1月8日 星期五
Open Google Play Store for your application
Reference:
http://stackoverflow.com/questions/11753000/how-to-open-the-google-play-store-directly-from-my-android-applicationCode snippet:
String appPackageName = "Your app package name";try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
訂閱:
文章 (Atom)