android-studio

RecyclerView expandable with Navigation Drawer item

时光毁灭记忆、已成空白 提交于 2021-02-07 04:38:12
问题 I am trying to implement recycler view instead of an expandable list view,so that when I click a navigation drawer menu item,t should expand.Her is my code,I don't how to implement. activity_main.xml: <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.NavigationView android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start"

Android Studio with NDK : link error : undefined reference to 'stderr'

五迷三道 提交于 2021-02-07 04:22:09
问题 I've compiled OpenCV static libraries targeting android armeabi-v7a. Now I'm trying to link my native C++ code with those libraries through a CMakeLists.txt file in Android Studio but this fails with this weird error : ~/opencv/modules/videoio/src/container_avi.cpp:0: error: undefined reference to 'stderr' This code comes from the libopencv_videoio.a The interresting part of the CMakeLists.txt file is this # linking with static libraries target_link_libraries(native-lib dnn ml objdetect shape

How to avoid occurring many AsyncTask class in my Android Room repository?

我的未来我决定 提交于 2021-02-07 04:19:21
问题 I'm learning how to use Android Room from google-developer-training, where I found example of repository class . I try to simplify my SportRepository class. I wonder how to avoid repetition of inner class ...AsyncTask in my code. Here is very sample example: @Singleton class SportRepository { val LOG_TAG = SportRepository::class.java.name @Inject lateinit var sportDAO: SportDAO var list: LiveData<List<Sport>> init { App.app().appComponent()?.inject(this) list = sportDAO.getAll() } fun insert

FB ads not loaded when i update FAN to 6.2.0 but ad loaded & shown on 5.+ sdk with same code

為{幸葍}努か 提交于 2021-02-07 04:17:03
问题 I works on integrating ads. But unfortunently When I update sdk to 6.2.0 Ads not loaded (No message appears) But on same code i change sdk to 5.+, Ads loaded and shown implementation 'com.facebook.android:audience-network-sdk:6.2.0' [Not loaded] implementation 'com.facebook.android:audience-network-sdk:5.+' [Loaded and shown] adView = new AdView(this, MainActivity.this.getString(R.string.facebook_banner_id), AdSize.BANNER_HEIGHT_50); // Find the Ad Container LinearLayout adContainer =

FB ads not loaded when i update FAN to 6.2.0 but ad loaded & shown on 5.+ sdk with same code

早过忘川 提交于 2021-02-07 04:15:34
问题 I works on integrating ads. But unfortunently When I update sdk to 6.2.0 Ads not loaded (No message appears) But on same code i change sdk to 5.+, Ads loaded and shown implementation 'com.facebook.android:audience-network-sdk:6.2.0' [Not loaded] implementation 'com.facebook.android:audience-network-sdk:5.+' [Loaded and shown] adView = new AdView(this, MainActivity.this.getString(R.string.facebook_banner_id), AdSize.BANNER_HEIGHT_50); // Find the Ad Container LinearLayout adContainer =

Developing a “system app” using Android Studio/AVD emulator

一曲冷凌霜 提交于 2021-02-07 02:57:35
问题 I'm developing an app that requires the android.permission.DUMP permission. This is only permitted for "system" apps (apps signed by the device vendor), or, I'm assuming, apps with root permissions. How does one develop (and test) an app like that using the AVD emulators? I declare the permission I need, and then build and run the app in the emulator, but when I get to the portion that runs, I run into the same permission error whether I specify the permission in the manifest or not. How does

How to use Gradle to generate JavaDoc in Android Studio?

霸气de小男生 提交于 2021-02-07 02:02:58
问题 I can not find any documentation on how to configure my Gradle file to create the JavaDoc for my project. I already tried some snippets from SO and blog articles but none of them seem to work or they do not provide context. This is my Gradle file. What do I need to do to add a task to generate JavaDoc? import org.apache.tools.ant.taskdefs.condition.Os apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 15 targetSdkVersion

Why does assembleDebug takes much longer then project build and how to optimize it?

青春壹個敷衍的年華 提交于 2021-02-06 19:31:36
问题 I've been dealing with gradle build time in Android Studio recently. I've managed to decrease the build time from about 3 mins to 10 seconds by removing some dependencies, but here's the thing: When I rebuild project it takes about 10 seconds: 15:13:43 Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources] 15:13:54 Gradle build finished in 11s 596ms However when I launch the app, it takes a lot

Why does assembleDebug takes much longer then project build and how to optimize it?

我的未来我决定 提交于 2021-02-06 19:31:06
问题 I've been dealing with gradle build time in Android Studio recently. I've managed to decrease the build time from about 3 mins to 10 seconds by removing some dependencies, but here's the thing: When I rebuild project it takes about 10 seconds: 15:13:43 Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources] 15:13:54 Gradle build finished in 11s 596ms However when I launch the app, it takes a lot

what is generated and intermediates folders in build directory and why outputs folder is missing

*爱你&永不变心* 提交于 2021-02-06 15:15:38
问题 I'm building application with Android Studio and Gradle. When the build is finished the build folder contains the following folders: - assets - CordovaLib - build - src - build.gradle - gradle - src - com.my.package - CordovaApp - build.gradle - build - generated - intermediates - outputs //not displayed in android studio's project tree - tmp //not displayed in android studio's project tree 1) What are generated, intermediates and tpm folders? 2) Why aren't the outputs and tmp folder shown in