Fourth, Android build system and custom Android platform system4.1Android compilation systemAndroid's source code is composed of hundreds of thousands of files, these files are interdependent, and some are independent of each other, they are placed in different directories by function or type, for this big project, Android through its own compilation system to co
12 practical Android skills: How to import a third-party class library to Android Studio
When a netizen's XMPP code is transferred from ADT to AS, it finds that it uses a third-party class library, the source code is placed under lib, and the project is directly imported in, third-party class libraries are not automatically imported in. It seems that you need to do it yourself.
The directory structure of t
How to deal with android methods that exceed 65536. the number of method references in a. dex file exceed 64 k, android. dexI. Problem description:
The number of Dex file methods in the application exceeds the upper limit of 65536. In short, the application burst.
Ii. solution:
Solution 1: Use a plug-in framework such as: https://github.com/singwhatiwanna/dynamic-load-apk
Solution 2: Split Dex
Iii. How to
Third-party class library source codeThe XMPP code of a netizen from ADT to as, found that it used a third-party class library, source code in the Lib, directly in as in the import project, the third-party class library is not automatically imported into, it seems to need to do their own hands.The directory structure of the project is as follows:XMPP$ lsapp build.gradle gradlew import-summary.txt XMPP.imlbuild gradle gradlew.bat local.properties settings.gradle
1
Android mistakes (2) and android mistakes
Check whether or not minSdkVersion is the same as the package on which you are dependent. It also has a prompt that the local 11 is displayed and the dependent package is 15. Then change it to 15 and build again.
ClassNotFoundException exception
Check whether the prompt message seems to be the path of the confi
Download Android Development sdk ndk and android development sdkndk
Version 2014.7
ADT BundleHttp://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zipHttp://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zipHttp://dl.google.com/android/adt/adt-bundle
Android uses AIDL for cross-process communication (IPC)
Before you do anything, do not think it is very difficult, because you have been afraid of it before you begin, this will prevent your progress. Maybe it is not very difficult when you start this step.
I. AIDL Overview
Meaning: AIDL (Android Interface Definition Language) is the android Interface Definition
Tell me what I'm trying to do before I finish this example.
First, modify the "Actionbarsherlock" navigation example. Before I implemented this example, I tried "actionbarsherlock" to modify one of its tab navigation examples, and the modification was successful. But finally found that it is not a actionbar implementation of the tab, can not hide Actionbar, when the Actionbar hide method is invoked, Actionbar is hidden, but the title of the tab page still exists, And in the lower version of
Android Phone Daemon can't close workaround
The problem with Android's back-end is entirely due to the Android broadcast system. In simple terms, when a user installs a program, the system will record the function of the program like the interviewer, when the user is using the mobile phone, the system state changes will produce various events, these events need some program to process, the system will send
Old Deng's android Study Notes (2)-Android gets screen resolutions in N ways, android-android
Android gets the screen resolution
Method 1: the simplest method
12
intscreenWidth=getWindowManager().getDefaultDisplay().getWidth();intscreenHeight=getWindowManager().g
stub
// Create a serversocket for listening to client socket connection requestsServerSocket ss = new ServerSocket (3000 );// Uses a loop to continuously accept requests from the clientWhile (true ){// The server also generates a socket whenever a request is received from the client socket.Socket s = ss. accept ();OutputStream OS = s. getOutputStream ();OS. write ("Hello, you have received the server's belief blessing \ n". getBytes ("UTF-8 "));// Close the output stream and socketOS. close ();
first configuration points to the installation path of Genymotion.
In this way, you can select a simulation device each time you start it.
Settings in Virtual Machine
Possible problems
Android-Studio if the simulation encounters a Failure [INSTALL_FAILED_OLDER_SDK] problem, it is because the compiled sdk version is too high or the minimum requirement is that the sdk is too high: minSdkVersion = "3"/> do
classpath 'com of 2.1.0-alpha5 provided by android. android. tools. build: gradle: 2.1.0-alpha5 '} // configure the repositories for all projects as jcentersallprojects {repositories {jcenter () }}// clear the project task clean (type: delete) {delete rootProject. buildDir}
Build. gradle in the moduleBuild in the module. gradle // This indicates that the module is an app moduleapply plugin: 'com.
Bound service
Before a service is bound to an activity, the activity only allows the service to work, but the service cannot return data to the activity. So here we will introduce the bound service.
Boundservice or service, so you need to configure it in the configuration file:
========= AndroidManifest. xml ==================================
Package = "com. yx. boundservice"Android: versionCode = "1"Android
This article was reproduced from: http://blog.csdn.net/csh86277516/article/details/73549824android--compiled release version of the signature system androidmanifest.xml in the android:shareduserid= "Android.uid.system", which means the same UID as the system, You can have permissions to modify system time, file operations, and so on.Also mention how to give a single apk signature, here to add the Android signature permission control mechanism.One: Sig
= (TextView) Findviewbyid (r.id.title); Tv.settext (GetVersion ()); }}3. Add a JNI recording. Add a file named HelloJni.cpp under JNI./jni/hellojni.cpp content such as the following#include 4. Under JNI, add a nameandroid.mkThe file./JNI/ANDROID.MK content such as the followingLocal_path:= $ (call My-dir) include $ (clear_vars) local_module : = libhellolocal_src_files: = Hellojni.cppinclude $ ( Build_shared_library)5. The file structure of the case is as follows:6. Perform the resultsNote:Ed
Preface
This chapter is the developer Guide/Developing/Managing Virtual Devices, version: Android3.1 r1, translated from: "MeetAndroid", welcome to visit his blog: "http://blog.csdn.net/meetandroid ", thanks again for "MeetAndroid "! We look forward to your participation in translation of Android related information, contact me over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: h
the following:Note: It is important to note that using the Mediametadataretriever class requires Android minsdkversion minimum of 14, so assume your Androidmanifest.xml file in Android: Minsdkversion= "8" is the smallest SDK version number is less than 14, will be an error, the solution can be changed in the Androidma
= Context.getpackagemanager () Getlaunchintentforpackage (basic_ Sample_package); //Clear out any previous instances nbsp Intent.addflags (intent.flag_activity_clear_task); context.startactivity (intent); //Wait for the app to appear MDEVICE.WA It (Until.hasobject (by.pkg (basic_sample_package) Depth (0), launch_timeout); }} In the example, the @SdkSuppress(minSdkVersion = 18) statement helps ensure that the test ru
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.