android-api-levels

how to Change my app's target API level from 23 to 26

会有一股神秘感。 提交于 2019-12-10 17:40:03
问题 I have a problem when i try to upload my app to google play console and it is the API level that is must be 26 and my app is just developped with 23 version and now i don't know how to change this API version from 23 to 26 to make it works without errors. Help me please! 回答1: Steps: Go to File >Project Structure. select App Module in left panel select Flavour tab from the top menu tabs You can change the Min SDK version (In your case change Target SDK Version to 26 ) Click Ok Reference: http:

Using theme references in XML drawables requires API level 21

北战南征 提交于 2019-12-10 14:33:23
问题 Is there a way to make following code compatible with lower API levels: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?android:attr/selectableItemBackground"/> <item android:gravity="bottom"> <shape android:shape="rectangle"> <size android:height="1px"/> <solid android:color="#ccc"/> </shape> </item> </layer-list> The part: android:drawable="?android:attr/selectableItemBackground" produces this message: Using theme references in XML drawables

Converting Android version 2.3 to 1.5

那年仲夏 提交于 2019-12-09 23:43:00
问题 I have developed one application in Android version 2.3, and want to convert it into 1.5. Unfortunately I am experiencing some problem with that. I have changed minSDK from 8 to 5 changed from property But I still get the problem. Any ideas? 回答1: If you have used any inbuild functions or methods or constants or attributes that was added after the release of android 1.5 and if you try to change to 1.5 now, you will not be able to do that. Make sure that you have not used such kind of methods

How to detect emoji support on Android by code

三世轮回 提交于 2019-12-09 02:58:22
问题 By code, I can make a button that inserts these 3 emojis into the text: ⚽️😈🐺 On many phones when the user clicks the button, though, the problem is that ⚽️😈🐺 displays as [X][X][X] . Or even worse, it displays only three empty spaces. I would like to disable and hide my own built-in emoji-keypad on Android devices that do not display emojis correctly. Does anyone knows or have a tip on how to detect in code if a device has emoji support? I have read that emoji is supported from android 4.1,

Downgrading from API 24 to API 23

佐手、 提交于 2019-12-08 07:56:27
问题 I cant drag and drop items either on activity_main.xml file or content_main.xml file. From my research, I learned that I have to downgrade from android API 24 to android API 23, but when I click on API 24 image to downgrade I can't find API 23. 回答1: Check the image and download API 23, then restart Android Studio and you will see API 23 too there. You will see this window, then start the download: 回答2: I think you are confusing rendering API level to application API level . You see, the icon

How to get a compile time error instead of NoSuchMethodError run-time error for android API level inconsistencies?

ε祈祈猫儿з 提交于 2019-12-08 07:50:57
问题 I have an Android Xamarin appliation with android:minSdkVersion="15" and android:targetSdkVersion="21" . Turned out that IDE (xamarin studio, visual studio) and compilation process just ignore if I'm using something above API 15 which is not expected behavior here. For example there is a method Path.addArc(float,float,float,float,float,float) from API 21 and I was able to use it with the manifest settings above which gave me a run-time error NoSuchMethodError . There is an easy fix to use an

Android: Unable to set getContext() in non-static method - requires API Level 23

淺唱寂寞╮ 提交于 2019-12-08 03:06:34
问题 Below, is some source code which is being called from a non-static method. I'm getting the error "Call requires API level 23 (current min is 15); android.app.Fragment#getContext" android.content.Context context = (Context) getContext(); How can I get the context object? Under the object explorer > Gradle Scripts > build.gradle, I see this. Looks like version 23 to me. Am I looking in the correct location? apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion

ripple drawable crashes the app on Android API 19

社会主义新天地 提交于 2019-12-07 01:28:00
问题 I am using a custom ripple drawable <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime" android:color="@android:color/white"> <item android:id="@android:id/mask"> <shape android:shape="rectangle" > <solid android:color="@android:color/white" /> </shape> </item> </ripple> but it crashes the app on API 19 android.content.res.Resources$NotFoundException: File res / drawable /

Android APIv29 FileNotFoundException EACCES (Permission denied)

微笑、不失礼 提交于 2019-12-06 06:33:13
问题 I'm not able to access storage when building for targetSdkVersion v29. Here is my gradle configuration: compileSdkVersion 29 buildToolsVersion "29.0.2" ... minSdkVersion 15 targetSdkVersion 29 NOTE that WRITE_EXTERNAL_STORAGE permission is granted and the same setup works fine when building for targetSdkVersion 28 . Here is my implementation: val outputFolder = File(baseFolder + File.separator + "Output Folder") if (!outputFolder.exists()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)

ripple drawable crashes the app on Android API 19

烈酒焚心 提交于 2019-12-05 05:38:01
I am using a custom ripple drawable <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime" android:color="@android:color/white"> <item android:id="@android:id/mask"> <shape android:shape="rectangle" > <solid android:color="@android:color/white" /> </shape> </item> </ripple> but it crashes the app on API 19 android.content.res.Resources$NotFoundException: File res / drawable / ripple_effect_square2.xml from drawable resource ID #0x7f02017d at android.content.res.Resources