android-10.0

can't control the initial directory where the SAF UI should start

為{幸葍}努か 提交于 2021-01-07 06:34:40
问题 I'm trying to save a text file using SAF (Storage Access Framework) but I can't control where it should be saved, I used this method from the Documentation as follows: private void createFile(Uri pickerInitialUri) { Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("text/*"); intent.putExtra(Intent.EXTRA_TITLE, "new.txt"); // Optionally, specify a URI for the directory that should be opened in // the system file picker when

Append data to text file in android 10 (API 29)

我们两清 提交于 2021-01-07 01:39:35
问题 I am working on an application where app writes a log file with the currentdate as filename Ex: 20200710.txt The earlier was working fine before android 10 but from android 10 the code is no longer writing the file in the external storage. So I have modified the code a bit for android 10 especially string logDir = "Documents/MyApp_Data/logs/"; Context context = MyApplication.Context; ContentValues values = new ContentValues(); values.Put(MediaStore.MediaColumns.DisplayName, filename); values

Append data to text file in android 10 (API 29)

末鹿安然 提交于 2021-01-07 01:37:10
问题 I am working on an application where app writes a log file with the currentdate as filename Ex: 20200710.txt The earlier was working fine before android 10 but from android 10 the code is no longer writing the file in the external storage. So I have modified the code a bit for android 10 especially string logDir = "Documents/MyApp_Data/logs/"; Context context = MyApplication.Context; ContentValues values = new ContentValues(); values.Put(MediaStore.MediaColumns.DisplayName, filename); values

How to split Linux (Android) ARM64 executable into small and large parts?

南笙酒味 提交于 2021-01-05 08:52:19
问题 Background I have an Android app which uses native ARM64 executables (essentially GCC toolchain, extracted to app directory ( /data/data/%package%/somePath ) on the first run) to do some work. Due to Android 10 changes files in /data/data/.. can't have executable permission anymore. Confirmed workaround The workaround is to make executables look like shared libraries (libsomething.so) that are extracted by Android to /data/app/%package% dir with android:extractNativeLibs="true" in

How to get an image's orientation information in android 10?

两盒软妹~` 提交于 2021-01-04 09:21:32
问题 Since android 10 there is some changes in accessing media files. After going through documentation https://developer.android.com/training/data-storage/shared/media i have been able to load the media content in to a bitmap, but i didn't get the orientation information. I know there is some restriction to the location information of the image, but does these exif restrictions also effect orientation information? If there is any other way to get an image's orientation information, please let me

Connect To Wifi Android Q

混江龙づ霸主 提交于 2020-12-29 07:36:51
问题 I'm trying to connect to wifi with below code val specifier = WifiNetworkSpecifier.Builder() .setSsid(machineID).build() val networkRequest = NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .setNetworkSpecifier(specifier) .build() val connectivityManager = context.applicationContext .getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? connectivityManager?.requestNetwork(networkRequest,object:ConnectivityManager.NetworkCallback(){ override fun

Connect To Wifi Android Q

余生长醉 提交于 2020-12-29 07:35:46
问题 I'm trying to connect to wifi with below code val specifier = WifiNetworkSpecifier.Builder() .setSsid(machineID).build() val networkRequest = NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_WIFI) .setNetworkSpecifier(specifier) .build() val connectivityManager = context.applicationContext .getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? connectivityManager?.requestNetwork(networkRequest,object:ConnectivityManager.NetworkCallback(){ override fun

How can I get unique device id in android 10?

最后都变了- 提交于 2020-12-13 18:08:16
问题 I want to get a unique device id in my application. But As per google document says Android 10 adds restrictions for non-resettable identifiers. I don't want random id. I want to get the unique id so I can identify the device from which my API gets hit. and by that, I can manage my session. is there is another unique id other than Secure.android_id which is unique for android? or is there any way to access the Secure.android_id in Android 10. 回答1: You will get the wifi mac address by using

How can I get unique device id in android 10?

∥☆過路亽.° 提交于 2020-12-13 17:57:25
问题 I want to get a unique device id in my application. But As per google document says Android 10 adds restrictions for non-resettable identifiers. I don't want random id. I want to get the unique id so I can identify the device from which my API gets hit. and by that, I can manage my session. is there is another unique id other than Secure.android_id which is unique for android? or is there any way to access the Secure.android_id in Android 10. 回答1: You will get the wifi mac address by using

How to start activity from service in Android10

a 夏天 提交于 2020-12-08 08:23:23
问题 I was starting activity from services till android P, but from android10 google has kept one restriction that activity cannot be started from background. https://developer.android.com/guide/components/activities/background-starts // below code stopped working Intent intent = new Intent(this, MyActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); what should i do for android10 ? 回答1: You can use a notification using setFullScreenIntent , it's the best you can