android-9.0-pie

Android P - 'SQLite: No Such Table Error' after copying database from assets

不羁岁月 提交于 2019-11-26 12:16:40
I have a database saved in my apps assets folder and I copy the database using the below code when the app first opens. inputStream = mContext.getAssets().open(Utils.getDatabaseName()); if(inputStream != null) { int mFileLength = inputStream.available(); String filePath = mContext.getDatabasePath(Utils.getDatabaseName()).getAbsolutePath(); // Save the downloaded file output = new FileOutputStream(filePath); byte data[] = new byte[1024]; long total = 0; int count; while ((count = inputStream.read(data)) != -1) { total += count; if(mFileLength != -1) { // Publish the progress publishProgress(

java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion

纵然是瞬间 提交于 2019-11-26 10:06:07
问题 I \'ve met such error when I use Android studio 3.1 to build an Android P \'s app, the apk can be made ,but when I use it on Android P emulator , it will crash and throw below info, more details see the pic. java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion part of my build.gradle under App module is below , anybody meet this ?And give some suggesstion ? Many thanks. android { compileSdkVersion \'android-P\' buildToolsVersion \'28-rc1\' useLibrary \'org

Download Manger not working in Android Pie 9.0 NetworkSecurityConfig: No Network Security Config specified, using platform default

痞子三分冷 提交于 2019-11-26 08:28:29
问题 On updating the device OS to Android 9.0 , previously this code was working fine( Xiaomi mi A2 ). Now, files are not being downloaded on Android Pie 9.0 . Moreover it is working fine in Oreo, Nougat , Marshmallow Here is the code snippet: File myDir = new File(Environment.getExternalStorageDirectory(), \"MyApp\"); if (!myDir.exists()) { myDir.mkdirs(); } String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\", Locale.getDefault()).format(new Date()); DownloadManager mgr = (DownloadManager

How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?

大兔子大兔子 提交于 2019-11-26 00:09:59
问题 From Android 9 Pie now, requests without encryption will never work. And by default, the System will expect you to use TLS by default.You can read this feature here So if you only make requests via HTTPS you are safe. But what about apps that make requests through different sites, for instance, browser-like apps. How can I enable requests to all types of connections HTTP and HTTPS in Android 9 Pie? 回答1: The easy way to implement this is to use this attribute to your AndroidManifest.xml where

How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?

跟風遠走 提交于 2019-11-25 19:25:11
From Android 9 Pie now, requests without encryption will never work. And by default, the System will expect you to use TLS by default. You can read this feature here So if you only make requests via HTTPS you are safe. But what about apps that make requests through different sites, for instance, browser-like apps. How can I enable requests to all types of connections HTTP and HTTPS in Android 9 Pie? The easy way to implement this is to use this attribute to your AndroidManifest.xml where you allow all http for all requests: android:usesCleartextTraffic="true" But in case you want some more