android-build

Packaging linux binary in Android apk

∥☆過路亽.° 提交于 2019-11-29 12:08:10
If I want to include a linux binary (like ffmpeg) in my .apk file (only for ARM based devices), is this possible to distribute for non rooted phones? I know it's possible to call an included binary with Runtime.exec() but is it a recommended practice? You can store the binary in res/raw or in assets folder. This way it will be deployed on the device. You should "extract" it after the installation, your /data/data/your.package/files/ is a valid destination; /sdcard/ is not. The usual /data/local/ destination is not accessible for your app, even if it is for an adb shell. chmod 500 is also fine.

Android MultiDex - Questions on Inner Workings

老子叫甜甜 提交于 2019-11-29 04:07:39
I recently discovered the new MultiDex functionality from Android for working with apps having more than 65,000 references. See: https://developer.android.com/tools/building/multidex.html Can someone help me understand the following questions: 1) How does the Gradle build plugin determine what to put in the primary dex file (classes.dex) vs the secondary dex files? Based on the doc there are certain things required to be in primary dex but it doesn't give any examples. Are all activities required to be in the primary dex file? Quoted Text: There are complex requirements regarding what classes

How to update Gradle dependencies to their latest version

◇◆丶佛笑我妖孽 提交于 2019-11-28 21:06:34
问题 Is there an easy way to get gradle to update dependencies to their latest available version? For build reproducibility all my dependencies are defined with a version number like this in my build.gradle file: dependencies { compile 'namespace:package1:version' compile 'namespace:package2:version' compile 'namespace:package3:version' } Periodically I want to update every package to their latest version. Typically this is the first thing I do for a new sprint after making a release. It's a real

Disable Android resource / image / PNG optimization

左心房为你撑大大i 提交于 2019-11-28 20:29:27
How do I prevent the Android "build process" from optimizing .png images? I have an Android project with the following res directories: - /res/ - /res/drawable - /res/drawable-hdpi - /res/drawable-hdpi-v5 - /res/drawable-ldpi - /res/drawable-ldpi-v5 - /res/drawable-mdpi - /res/drawable-mdpi-v5 These directories contain many .png files . I optimize PNG sizes with PNGOUTWin, and the overall size is reduced by more than 20%. When I build the .apk file, the images are "optimized" by the build process and the overall size is now 10% above the initial size , or 30% above my/PNGOUTWin optimized size.

aar support in Android.mk

谁说胖子不能爱 提交于 2019-11-28 18:59:12
I am doing android custom ROM development now. the build system of aosp is based on Android.mk, But I want to include some aar libraries, is it possible to include aar libaries in Android.mk ? You should add following blocks into your Android.mk LOCAL_STATIC_JAVA_AAR_LIBRARIES:= <aar alias> . . . include $(BUILD_PACKAGE) include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := <aar alias>:libs/<lib file>.aar include $(BUILD_MULTI_PREBUILT) Please also be aware of satisfy minSdkVersion required by library into your manifest file. Kostiantyn Luzan's answer has a problem. After compile, the

How to convert an Eclipse Android project to use Ant for build?

戏子无情 提交于 2019-11-28 16:26:33
问题 I have an Android project in Eclipse I would like to convert to be built with Ant instead. How can I achieve this? I have tried exporting an Ant build file but I'm pretty sure that's not going to work (nor does it when running ant with the exported file). I do not know much about Ant either so some explanation would also help. EDIT: now I seem to have managed to create the needed build file but I need to add the projects libs like admob.jar to be seen by ant and used to build. as I am getting

While making build in Cordova using cmd

╄→гoц情女王★ 提交于 2019-11-28 13:14:19
While making build using Cordova by cdm it is sending this error **Starting a new Gradle Daemon for this build (subsequent builds will be faster). FAILURE: Build failed with an exception. What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/ 2.14.1/userguide/gradle_daemon.html Please read the following process output to find out more: Error occurred during initialization of VM Could not reserve

Android : Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker

旧巷老猫 提交于 2019-11-28 13:02:24
I have an app that makes use of the Google Analytics library. I recently moved the code into a new workspace and the app has stopped working. The code builds OK but when it runs it halts with the following error. 06-12 23:11:14.117: I/dalvikvm(31080): Could not find method com.google.analytics.tracking.android.EasyTracker.getTracker, referenced from method com.apps4care.v2conf.utils.analytics.raiseEvent 06-12 23:11:14.117: W/dalvikvm(31080): VFY: unable to resolve static method 7179: Lcom/google/analytics/tracking/android/EasyTracker;.getTracker ()Lcom/google/analytics/tracking/android/Tracker

Android Gradle Plugin 1.1.0 - getNdkFolder() not found anymore, any replacement?

老子叫甜甜 提交于 2019-11-28 10:04:41
I just updated android Gradle plugin to 1.1.0 from 1.0.0, and I got this error: No signature of method: com.android.build.gradle.LibraryPlugin.getNdkFolder() is applicable for argument types: () values: [] I tried to find diff of gradle plugin 1.0.0 to 1.1.0 but couldn't find anywhere online. Seems like getNdkFolder method has been either changed or removed. Is there a replacement ? Or any other way to get NdkFolder ? I'm using that method like this, def ndkDir = project.plugins.findPlugin ( 'com.android.library' ).getNdkFolder () I have also filed an issue against tools team in Android issue

How do I run the Android Emulator after a Build?

送分小仙女□ 提交于 2019-11-28 09:30:30
So I have download the source code successfully, built it successfully, and can run the emulator successfully. However it never boots into the actual image. Instead I look at the terminal and it gives me the following error. OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x2deae10 OpenGL Warning: Retry with 0x105 returned 1 visuals Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. destroyOpenGLSubwindow not implemented for separate renderer process !!! createOpenGLSubwindow not implemented for separate renderer process !