android-studio

Emulated Android Device shows wrong date (Windows 10)

杀马特。学长 韩版系。学妹 提交于 2020-05-17 07:46:11
问题 I created an app with Android Studio on my PC with Windows 10. A wrong date (PC-Date minus 2 hours) is shown in the emulation device 'Pixel_2_API_28 [emulator-5554] and I try to correct this adb date in the app with Java: final long jetzt = System.currentTimeMillis() / 1000L; final ProcessBuilder builder = new ProcessBuilder("adb", "date", Long.toString(jetzt)); builder.redirectErrorStream(true); builder.redirectOutput(ProcessBuilder.Redirect.INHERIT); final Process process = builder.start();

Android Studio: Configure offline build dependencies

大城市里の小女人 提交于 2020-05-17 07:45:06
问题 Good day, I followed the instructions in the "Configure you Android Studio Page" to install offline build dependencies(found here https://developer.android.com/studio/intro/studio-config#offline). Downloaded the gradle plugin and the maven dependencies, unzipped them into the required folder, and also created the offline.gradle file, putting it in the appropriate folder. However, in the guide, it was said that to test it is working, one needs to comment the repositories in the build.gradle

how to replace url in webview android studio?

耗尽温柔 提交于 2020-05-17 07:33:08
问题 i am getting first that URL contain ad then i want to replace ad with as how to replace ad with as. @Override protected void onStart() { super.onStart(); Intent intent = getIntent(); Uri data = intent.getData(); //want to check contains in data and if contains i want to replace it if(data.toString().contains("ad")){ data.toString() = data.toString().replace("ad", "xyz"); } try { webView.loadUrl(data.toString()); } catch (Exception e){ e.printStackTrace(); } } 回答1: The method that may help you

how to replace url in webview android studio?

亡梦爱人 提交于 2020-05-17 07:31:04
问题 i am getting first that URL contain ad then i want to replace ad with as how to replace ad with as. @Override protected void onStart() { super.onStart(); Intent intent = getIntent(); Uri data = intent.getData(); //want to check contains in data and if contains i want to replace it if(data.toString().contains("ad")){ data.toString() = data.toString().replace("ad", "xyz"); } try { webView.loadUrl(data.toString()); } catch (Exception e){ e.printStackTrace(); } } 回答1: The method that may help you

ERROR: Module 'app': platform 'android-28' not found. and Design editor is unavailable until after a successful project sync

﹥>﹥吖頭↗ 提交于 2020-05-17 07:02:10
问题 So, I am new here just installed Android Studio and then wanted to create a basic activity. But the thing is they want me to install the SDKs and Haxm which is not being installed through SDK manager. I have tried a lot and have used all the ways stated in Stack-overflow to get rid of this but none of their ways has functioned. 回答1: First of all! you need to update your sdk manager that too essential tools are: build tools platform tools tools and android Emulator ..... Now go to LOGCAT ,

Why in Android studio i can not find most of Attributes to add for views in XML layout like padding,textSize and etc

江枫思渺然 提交于 2020-05-17 06:46:25
问题 Before when in XML layout I was typing {t} android studio brings some suggestion and by chose which one I want it completed automatically and still in the old project Suggestion and Auto Complete is working like below image But in new project when i want to add Vertical orientation at most it suggest orientation and i should write vertical completely by myself and for example to define "textSize" i should write completely by my self and android doesn't suggest also for adding new View i

Test CoroutineScope infrastructure in Kotlin

冷暖自知 提交于 2020-05-17 06:45:27
问题 would someone be able to show me how to make the getMovies function in this viewModel testable? I can't get the unit tests to await the coroutines properly.. (1) I'm pretty sure I have to create a test-CoroutineScope and a normal lifeCycle-CoroutineScope, as seen in this Medium Article. (2) Once the scope definitions are made, I'm also unsure how to tell getMovies() which scope it should be using given a normal app context or a test context. enum class MovieApiStatus { LOADING, ERROR, DONE }

How to decode strange HTML entities like &#8217 in wordpress?

对着背影说爱祢 提交于 2020-05-17 06:26:07
问题 I'm developing WordPress Android app which loads post from my Wordpress site using JSON API. In JSON data its found some special characters &#8230, &#8217, &#8230 . when android webview loads post it stops loading at this special characters. It doesn't loads the data after this characters. How to decode or skip/delete these characters in wordpress site or android app. In one of the post contain &#8217 after this character post is not visible. It has decoded only & but failed to decode #8217 I

how to get sha-1 in android studio 3.6.2? [closed]

亡梦爱人 提交于 2020-05-17 05:57:22
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 days ago . how to get sha-1 in the version of android studio 3.6.2 ? 回答1: gradle->app->Tasks->android->signingReport Also Try this command in terminal: In Windows: keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android In Linux or macOS:

JNI “undefined reference” to c++ method

耗尽温柔 提交于 2020-05-17 05:48:07
问题 I'm trying to create poker app with JNI in android studio, I want to save one instance of c++ class (TexasHoldem) and invoke it's methods only. in the texasJNI.java I wrote: public class jniTexasHoldem { private long texasHoldm; jniTexasHoldem() { ConstructNativeTexas(); } // Used to load the 'native-lib' library on application startup. static { System.loadLibrary("native-lib"); } /** * A native method that is implemented by the 'native-lib' native library, * which is packaged with this