android features of each system

 

Android 8.0  

① notification bar adapter

Figure I

② subscript function

The good news is, starting with the 8.0 system, Google has developed a subscript specification on the Android system, but also provides a standard API, allows developers to long-term headache for this problem can now finally been resolved.

So here we come to learn about how to implement the subject of unread angle effect on the Android system. Modify the code of MainActivity, as it follows:

public classMainActivityextendsAppCompatActivity{

   ...

   @TargetApi(Build.VERSION_CODES.O)

   privatevoidcreateNotificationChannel(String channelId, String channelName,intimportance){

       NotificationChannel channel = new NotificationChannel(channelId, channelName, importance);

       channel.setShowBadge(true);

       NotificationManager notificationManager = (NotificationManager) getSystemService(

               NOTIFICATION_SERVICE);

       notificationManager.createNotificationChannel(channel);

   }

 

   publicvoidsendSubscribeMsg(View view){

       NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

       Notification notification = new NotificationCompat.Builder(this, "subscribe")

               ...

               .setNumber (2)

               .build();

       manager.notify(2, notification);

   }

 

}

We can see, here we modified the two places. The first is when you create a notification channel, called NotificationChannel of setShowBadge (true) method, a notice under this representation allows the display channels subscript. The second is when creating the notification, called setNumber () method, passing in the number of unread messages.

Now re-run the program and click the button to send a subscription message, and then find NotificationTest this application in the Launcher, as shown below:

  

Figure II

③ excerpt from http://mp.weixin.qq.com/s/Ez-G_9hzUCOjU8rRnsW8SA

Android 7.0

The new error occurred while calling camera Android7.0:

android.os.FileUriExposedException: file:///storage/emulated/0/photo.jpeg exposed beyond app through ClipData.Item.getUri()

 
 

Solution:

() Method to add the following code in the Application onCreat:

// android 7.0 system to solve the problem of camera

StrictMode.VmPolicy.Builder builder =newStrictMode.VmPolicy.Builder();        

StrictMode.setVmPolicy(builder.build());        

builder.detectFileUriExposure();


 

 

Android 4.4 (API19)

1. immersive status bar
2.WebView webview debugging features

 WebView.setWebContentsDebuggingEnabled(true);
  1. WebView increase ignore all certificate requests to https https certificate restrictions need to verify or set

Android 5.0 (API 21)

Http and Https on WebView in mixing problems 1.Android5.0

/**
 * MIXED_CONTENT_ALWAYS_ALLOW:允许从任何来源加载内容,即使起源是不安全的;
 * MIXED_CONTENT_NEVER_ALLOW:不允许Https加载Http的内容,即不允许从安全的起源去加载一个不安全的资源;
 * MIXED_CONTENT_COMPATIBILITY_MODE:当涉及到混合式内容时,WebView 会尝试去兼容最新Web浏览器的风格。
 **/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } 
  1. WebView cookie storage problems
   public static void syncCookie(String url, String key) { CookieManager cookieManager = CookieManager.getInstance(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { cookieManager.removeSessionCookies(null); cookieManager.flush(); } else { cookieManager.removeSessionCookie(); CookieSyncManager.getInstance().sync(); } cookieManager.setAcceptCookie(true); cookieManager.setCookie(url, key); } 
  1. Add cool animated transitions

Android 6.0 (API23)

  1. Fingerprint recognition
  2. Runtime permissions

Android 7.0(API24)

File read and write permissions adaptation

Android 8.0 (API26)

Notification bar adapter

Android 9.0 (API28)

Network adapter issue http request

 

Android9.0

Android 9.0 behavior change
Android P version of the application compatibility adaptation of technical guidance
Android P APP adaptation of summary, let you quick step

Android8.0

Android 8.0 behavior change
Android O adapter detailed guide to
Android 8.0 adaptation refers to the North

Android7.0

Android 7.0 behavior change
Android 7.0 adaptation tutorials, tips

Android6.0

Android 6.0 behavior change

Android 6.0 Adapter

Solve the problem of library privileges:

https://github.com/tbruyelle/RxPermissions (recommended)

https://github.com/yanzhenjie/AndPermission

https://github.com/googlesamples/easypermissions

https://github.com/permissions-dispatcher/PermissionsDispatcher

Do not use the library solution:

https://blog.csdn.net/lhp15575865420/article/details/79210696

Dangerous Permissions

 

Android7.0 adaptation

https://blog.csdn.net/qq_17766199/article/details/77404712

1. The Inter-application sharing files

7.0 permissiongen solve your camera crash

https://github.com/lovedise/PermissionGen

Do not use the library solution:

https://blog.csdn.net/lmj623565791/article/details/72859156

2 APK signature scheme v2

1) just check the signature is signed v1 traditional programs, but do not use on 7.0 V2 secure authentication.

2) just check the V2 signature appears below 7.0 is not installed, it will use a 7.0 V2 secure authentication.

3) At the same time check the V1 and V2 versions are all no problem.

3, org.apache not support issues

// android app add this sentence in which at build.gradle

defaultConfig {

    useLibrary 'org.apache.http.legacy'

}

Android8.0 adaptation

https://mp.weixin.qq.com/s/MhWurQy9oOf9OuDsdBLU-w

1, adapting the icon

https://blog.csdn.net/guolin_blog/article/details/79417483

2, inform adaptation

https://blog.csdn.net/guolin_blog/article/details/79854070

3, install APK

https://blog.csdn.net/kac930/article/details/79131671

 

Android9.0 adaptation

https://www.jianshu.com/p/9e9e902ea039

https://blog.csdn.net/chen_lian_/article/details/81516654

https://mp.weixin.qq.com/s/K9eIN0veW96sjXoczHms5w

Android10.0 adaptation

https://juejin.im/post/5cad5b7ce51d456e5a0728b0

 
 

Guess you like

Origin www.cnblogs.com/awkflf11/p/12555999.html