Chapter One Android system and system architecture

Source: Internet
Author: User

1. Dalvik and ART (Android Runtime)
Application in Dalvik is like a foldable bicycle, usually folded, only when riding, it needs to be assembled.
Application in art is like a well-assembled bike that can be mounted.

2. Android Source directory structure: (one can view the Android code site: http://androidxref.com/)

  Makefile(Describe the links between the various components of Android and instruct them to compile automatically)
  bionic(Bionic C library)
  bootable(Start boot-related code)
  build(Basic development package configuration such as System compilation rules)
  cts(Google Compatibility Test standard)
  dalvik(Dalvik virtual machine)
  development(Application development related)
  external(some open source modules used by Android)
  frameworks(Framework framework Core)
  hardware(Vendor hardware adaptation layer HAL)
  out(The Code output directory after compilation is complete)
  packages(Application package)
  prebuilt(Precompiled resources under x86 and ARM architectures)
  sdk(SDK and Simulator)
  system(underlying file system libraries, applications, and components)
  vendor(Vendor custom code)

3.Android system Catalog
  /systemAnd the /data two directories that developers are particularly concerned about.

  /systemThe main categories are:,,,, /app /fonts /framework /lib /media , /usr etc subdirectories
For example, view the system's properties information file /system/build.prop :

[Email Protected]_umts:/system $ cat Build.prop
#BeginBuild Properties
# autogeneratedby buildinfo.sh
Ro.Build.id=lmy47m. M003
Ro.Build.display.id=lmy47m. M003
Ro.Build.Version.incremental=8
Ro.Build.version.sdk=22
Ro.Build.Version.codename=rel
Ro.Build.Version.all_codenames=rel
Ro.Build.Version.Release=5.1
Ro.Build.Date=wed1910:44:PDT2015
Ro.Build.Date.utc=1440006297
Ro.build. type=User
Ro.build. User=hdsplat
Ro.build.host=buildlinux16
Ro.build.tags=release-keys
Ro.build.flavor=falcon_gpe-User
Ro.product. model=xt1032
Ro.product.brand=motorola
Ro.product. NAME=FALCON_GPE
Ro.product.device=falcon_umts
ro.product.board=msm8226
......

  /dataUnder the main directory,,, and /app /data /system /misc Other subdirectories, which /data/data are the most visited directory of developers, which contains the app's data information, file information and database information, in the way of package name to distinguish between different applications.

Chapter II new contacts for Android development tools

Source of the 1.ADB command
  /system/core/toolboxAnd /frameworks/base/cmds is the source of all ADB commands and shell commands, linked here is the source path for Android 6.0.

2. Common Android Commands
  android list avdsList all created Android emulators

Android List devices
  android list targetsList all of our SDK versions available

Hujiawei-mbpr:hexoblog hujiawei$ Android list targets
Available Android Targets:
----------
Id:1 or "android-8"
Name:android 2.2
Type:platform
API Level:8
Revision:3
SKINS:HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
Tag/abis:default/armeabi
----------
Id:2 or "android-10"
Name:android 2.3.3
Type:platform
API level:10
Revision:2
SKINS:HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
Tag/abis:default/armeabi
----------
id:3 or "android-15"
name:android 4.0.3
Type:platform
API level:15
Span class= "line" > Revision:5
SKINS:HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800
Tag/abis:no ABIs.
----------

3. Commonly used ADB commands
  adb push <local> <remote>, adb pull <remote> <local> (File transfer)
  adb install xxx, adb uninstall yyy (apk install and uninstall)
  adb usb,,, adb tcpip <port> adb connect adb devices (connect related commands)
  adb start-server,,, adb kill-server adb reboot adb remount (re-mount the system partition to make the system partition writable)

  adb shellRelated commands:
  adb shell df(View system drive letter)
  adb shell input keyevent(Analog key input, for example, adb shell input keyevent 3 Press home button)
  adb shell input touchscreen(analog touchscreen input, e.g. adb shell input touchscreen swipe 18 665 18 350 )

  adb shell dumpsys activity activities(View activity running status)

Hujiawei-mbpr:hexoblog hujiawei$ADB shell Dumpsys activity activities
ACTIVITY MANAGERActivities(Dumpsys activity Activities)
Display#0 (activities from top to bottom):
Stack#0:
Task ID#279
* taskrecord{2fbcccec#279 A=com.android.launcher u=0 sz=1}
Userid=0 EFFECTIVEUID=U0A15 mcallinguid=Mcallingpackage=android
Affinity=com.android.launcher
Intent={act=android.intent.action.main Cat=[android.intent.category.home] Flg=0x10000000 Cmp=com.android.launcher/com.android.launcher2.launcher}
Realactivity=com.android.launcher/com.android.launcher2.launcher
autoremoverecents=False ispersistable=True numfullscreen=1 tasktype=1 mtasktoreturnto=0
rootwasreset=false mneverrelinquishidentity=true mreusetask=false
activities=[activityrecord{74b834e u0 com.android.launcher/com.android.launcher2.launcher t279}]
Askedcompatmode=false inrecents=true isavailable=True
Lastthumbnail=null lastthumbnailfile=/data/system/recent_images/279_task_thumbnail.png
Hasbeenvisible=true firstactivetime=1448539994507 lastactivetime=1448539994507 (inactive for 58s)

  adb pm xxx(Package management information)
For example, see all the Packages

Hujiawei-mbpr:hexoblog hujiawei$ adb shell pm list packages-f
Package:/system/app/youtube/youtube.apk=com. google. Android. YouTube
Package:/system/priv-app/telephonyprovider/telephonyprovider.apk=com. Android. Providers. telephony
Package:/system/app/mediashortcuts/mediashortcuts.apk=com. google. Android. Gallery3d
Package:/data/app/com. Support. Android. designlibdemo-1/base.apk=com. Support. Android. Designlibdemo
Package:/system/priv-app/velvet/velvet.apk=com. google. Android. Googlequicksearchbox
Package:/system/priv-app/calendarprovider/calendarprovider.apk=com. Android. Providers. calendar
Package:/data/app/com. Imooc. animatedselector-1/base.apk=com. Imooc. animatedselector
Package:/system/priv-app/mediaprovider/mediaprovider.apk=com. Android. Providers. media
Package:/system/priv-app/googleonetimeinitializer/googleonetimeinitializer.apk=com. google. Android. Onetimeinitializer
package:/data/app/com.wandoujia-1/base.apk=com. Wandoujia
Package:/system/app/bug2gostub/bug2gostub.apk=com. Motorola. bug2go
Package:/data/app/com.sina.weibo.sdk.gensign-1/ Base.apk=com.sina.weibo.sdk package:/data/app/com.sohu.inputmethod< Span class= "class" >.sogou-1/base.apk=com.sohu.inputmethod .sogou
package:/system/priv-app/wallpapercropper/ Wallpapercropper.apk=com.android.wallpapercropper
package:/data/app/com.jredu.netease .news-1/base.apk=com.jredu.netease .news

  adb am xxx(Activity Management Information)
For example, start an activityadb shell am start -n packageName[+className]

Start Com.wandoujia
starting:intent {act=android.intent. Action. MAIN cat=[android.intent. Category. LAUNCHER] Pkg=com.wandoujia}

Chapter One Android system and system architecture

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.