Android journey 2 @Android framework

At the moment, I am still a rookie android, android has just started to learn the knowledge and to use the blog record their own learning process, on the one hand provide help to others, on the other hand to place a review of their own.

Before learning with Android, to begin to share a few useful sites:

1)Android developer

2)Google code

3)StackOverFlow

4)Android developers need to know

E-learning resources everywhere, we are mainly preferred to learn to use, full use of, and better resources are in English, so it can improve the level of English together, let's come on with it! !

Can first look at Android before learning the history of Android , let us try to understand the system architecture of android development environment configuration :( self-understanding)

  • Linux Kernel Layer: the students learned the operating system should know, a basic operating system functions include into the (line) process management, memory management, file management, device (I / O) management, for now multi-core CPU , may also consider the management processor and android choose Linux as its underlying, it goes where, on the one hand may be due to the open-source Linux, on the other hand of course, because Linux system itself irreplaceable advantages. In the android system involved in the Linux kernel Layer, mainly to provide a variety of driver, because os the most basic function is to separate the underlying hardware with software, hardware, and also according to the situation, unified management scheduling software.
  • System lib Layer: This layer is developed using C ++, including a variety of local libraries, such as multimedia, database, network, images, etc., the hardware abstraction layer HAL, is responsible for dealing with low-level driver, there is a running android, worth mentioning too is the Dalvik VM JVM is based on a re-customize virtual machine that functions more than the JVM step is also the .class files into executable files by dx.bat .dex batch file, in order to run on Dalvik.
  • Framework Layer: API available to developers using all kinds, in addition to use, we can also see its source files, which help us to understand the entire android system

    Q: Android is not the main function, that its program Where is the entrance?

    A: A xml configuration file, <intent-filter> <action android: name = "android.intent.action.MAIN" /> </ intent-filter>

The following introduce several Android common sense (including common tools):

1, the installation software .apk format, the system-level software / system / app, at a third-party software / data / app, on the corresponding data / data / data;

2, ddms: dalvik debug manage system dalvik virtual machine debugging system.

3, aapt: android application package tools android application packaging tool

4, adb.exe: android debug bridge android debug bridge (. I recommend to add environment variables)

adb devices: lists the devices connected to the computer
adb shell: come simulator or a real phone terminal to execute linux commands..
adb the Push: put a file on the computer on which the simulator.

adb pull: the exported file to the phone inside the computer.

5, dx.bat: to become .dex .class file, usually on a real phone to see .odex .dex file is compressed, encrypted, generated signature

6, dexdump: decompile .dex file, but the resulting file is called smali another language? !

7, directly extract apk, because the file is encrypted, so most of the content is not visible, only the raw files and other graphics files found

8, on access to the resource file:

. 1) raw res resource is accessed through R file: getResources () openRawResource (R.raw ....);

2) asset resources are accessed directly through a path which does not configure the resource file to the R, it is also faster access;

9, by apktool effects on apk file decompiled: .dex become smali, but the xml layout file is visible

10, another successful decompilation methods:

Use dex2jar the .dex become .jar, .jar by XJad tool becomes (.class) .java

11, information about the logcat:

pid: process id, log categories (arranged by severity): Error, warn, infor, debug, verbose, or program error debugger had to view the log, log on information / data / log

12, the case generated log file:

1) the program quit unexpectedly: uncased exception

2) forced shutdown: force closed (FC), "Fatal Exception: Nullpoint, classnotfound other"

3) No response: Reason App No Response (ANR), this situation is usually:

a. interface operation waits for the response time exceeds 5s

b.HandleMessage callback function to perform over 10s, for example, BroadcastReceiver life cycle of only about 10 seconds, if the rewrite onReceive (more than 10 seconds to do business) inside, ANR error occurs,

Usually more time-consuming task should be completed by Intent issued to service, can not be solved by the child thread, 'causeBroadcastReceiver life cycle is too short, the thread is not the end, it is hung up, the process has become empty, the system is likely to be directly kill

13, generally two kinds of mobile phone factory modes:

1) development: to have root privileges, play a lot of support ,, log file;

2) user: generally do not play log

14, log file information: basic information system, memory, CPU, garbage collection; event information (in the form DDMS); virtual machine information, process, thread tracking

15, wanted to give the students some of the software development tips: the software industry has the potential to pressure the industry should learn to avoid, as far as possible the same kind of innovation to meet customer needs

 

Reproduced in: https: //www.cnblogs.com/allenpengyu/p/3495486.html

Guess you like

Origin blog.csdn.net/weixin_34050427/article/details/94507581