android-studio

How to create a folder in Download directory (Android Studio)

风流意气都作罢 提交于 2021-01-28 10:23:51
问题 I'd like to create a directory in a Download directory (the one which stores all the files I download from web) so I can see it in browser after I plug the mobile into my PC. File myDirectory = new File(dir, "NewDirectory"); What should be the value of dir? 回答1: File dir = new File(Environment.getExternalStorageDirectory() + "/Download/your folder/"); dir.mkdirs(); // creates needed dirs Don't forget to ask for permissions on Marshmallow or newer and to add the write storage permission to

Can I still use JKS keystore to publish app to Google Play when I use Android Studio 4.0?

ⅰ亾dé卋堺 提交于 2021-01-28 09:49:47
问题 I get the informtion 'It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore -destkeystore -deststoretype pkcs12" ' when I try to 'Generate Signed Bundle / APK ...' I get the error "Given final block not properly padded. Such issues can arise if a bad key is used during decryption." after I update my keystore to PKCS12 based the artical. Now I hope to give up PKCS12, can I still use JKS keystore to publish app to Google Play

emulator runs fine but app shows white screen, error is below

我怕爱的太早我们不能终老 提交于 2021-01-28 09:36:16
问题 Good day to all. I'm following the teacher's notes and am ready to run the app in android studio 3.6.1. The emulator runs fine but when I open the app I get a white screen. At the bottom of the android windows, I see the following error. Emulator: emulator: INFO: QtLogger.cpp:68: Critical: Uncaught TypeError: Cannot read property 'update' of undefined (qrc:/html/js/location-mock-web-channel.js:130, (null)) I have searched this website and google for the problem. I'm trying to figure out if

Unable to locate a development device Flutter

久未见 提交于 2021-01-28 09:24:06
问题 I have a probleme with flutter. I install Android Studio and configure that for flutter (install flutter and Dart) but I can't run my app on any device and android studio console returned: Unable to locate a development device; please run 'flutter doctor' for information about installing additional components. and flutter doctor -v : [✓] Flutter (Channel beta, v0.8.2, on Linux, locale en_US.UTF-8) • Flutter version 0.8.2 at /home/mostafa/Dev/Flutter/flutter • Framework revision 5ab9e70727 (4

JDK path for Android Studio on Linux

為{幸葍}努か 提交于 2021-01-28 08:39:48
问题 I am running Manjaro 17.0.1 I have an issue running android studio . When I run ./studio.sh I have: A graphical error message from Android Studio saying No JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation A console error message which: no java in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl) /usr/bin/dirname: missing operand Try '/usr/bin/dirname --help' for more

Android Studio 4.1 - Plugin “Install Apk” is incompatible [duplicate]

时光总嘲笑我的痴心妄想 提交于 2021-01-28 07:38:29
问题 This question already has answers here : Android Studio 4.1 Plugin Error: Plugin * is incompatible (supported only in IntelliJ IDEA) (13 answers) Closed last month . Since upgrading to AS 4.1 from 4.0 I get the event log message Plugin Error: Plugin "Install Apk" is incompatible (supported only in IntelliJ IDEA). on starting AS. Yes, this is like a previous report1, but this appears to be a bundled plugin. I don't think it's anything I've added, nor can I find anything obviously out of place

How to get an image resource by it's name in android? [duplicate]

Deadly 提交于 2021-01-28 07:04:26
问题 This question already has answers here : How to get a resource id with a known resource name? (10 answers) Closed 4 years ago . I want create a country and flag picker. I want to set an image of a flag, but i want to choose that image based on it's name. BAscially I am trying to create a flag and ISD code picker for android so that I can use it for adding ISD code before the phone numbers user. ImageView img1 = (ImageView)findViewById(R.id.imgFlag); img1.setBackgroundResource(R.drawable.India

Passing arguments to intent android

ⅰ亾dé卋堺 提交于 2021-01-28 06:09:01
问题 I have the first intent, it starts the second intent. In the second intent, I get the values, and pass the value to the first content and close the second content. How can I do it? 回答1: You can directly pass parameters to the intent when you create it. If you need to pass objects you need to implement Parcelable interface on the object you pass: Intent i = new Intent(MyActivity.this, SecondActivity.class); MyData j = new MyData(); i.putExtra("MyParameter", "Something"); i.putExtra("MyData", j

API data in kotlin fragment

独自空忆成欢 提交于 2021-01-28 06:01:46
问题 I am trying to use Drawer activity , seems that it has 3 files to just show simple text as This is home Fragment :| Anyway, I have tracked back all those files and found fragment_home.xml , HomeFragment.kt and HomeViewModel.kt Question How should I call for API data trough fragments? Code my code Based on android studio documentation this is the code that I should use in order to get my api data. val textView = findViewById<TextView>(R.id.TextView) // Instantiate the RequestQueue. val queue =

Firebase error when trying to get a file download url from firebase

。_饼干妹妹 提交于 2021-01-28 06:01:16
问题 I'm trying to upload an image file and get the image download URL using this code private void UploadImage() { String storageFileName = System.currentTimeMillis() + ".jpg"; // Time is used to ensure unique file name FireBase_File = FireBase_Storage.child(storageFileName); FireBase_File.putFile(UriBitmap).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() { @Override public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) { if(task.isSuccessful()) { FireBase