• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Core Android
 

Core Android

on

  • 507 views

In dieser Session werfen wir einen Blick auf die Android Platform jenseits der Dalvik VM. Wir entdecken den Android Source Code und erklären wo sich interessante Beispiele und Referenzen für ...

In dieser Session werfen wir einen Blick auf die Android Platform jenseits der Dalvik VM. Wir entdecken den Android Source Code und erklären wo sich interessante Beispiele und Referenzen für App-Entwickler sowie nützliche Tools verbergen. Ein High-Level Überblick über die Platform-Architektur und das Platform-Build-System runden die Session ab.

Statistics

Views

Total Views
507
Views on SlideShare
507
Embed Views
0

Actions

Likes
1
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Core Android Core Android Presentation Transcript

    • Dominik Helleberg | inovex GmbHCore Android
    • Dominik Helleberg Mobile Development Android HTML5 http://dominik-helleberg.de/+
    • CoreAndroid
    • Warum? Neugier Verständnis - Bugs - Beispiele - Doku Anwendungen / Projektehttp://www.ouya.tv/about/https://mediacenter.motorola.com/Image-Gallery/MOTOACTV-Golf-Edition-8c1.aspxhttp://www.tolino.dehttps://www.honeywellaidc.com/en-US/resources/image-library/Pages/default.aspx?Category=7800&keywords=7800&title=7800&description=7800
    • Android is different…
    • Android is open?https://twitter.com/Arubin/status/27808662429
    • Android Architektur Stock Apps User Apps Framework / API Java System Services Dalvik / Runtime / Zygote Libs HAL Init Kernel
    • Android Architektur / Source https://android.googlesource.com/ Stock Apps User Apps Framework / API Java System Services Dalvik / Runtime / Zygote Libs HAL Init Kernel
    • Get the source!$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod a+x ~/bin/repo$ repo init -u https://android.googlesource.com/platform/manifest$ repo syncCheck: http://source.android.comSources: approx. 16 GB
    • Getting around AOSPabi docs packagesbionic external pdkbootable frameworks prebuiltsbuild gdk sdkcts hardware systemdalvik libcore toolsdevelopment libnativehelperdevice ndk
    • Getting around AOSP Stock Apps abi docs IMEs packages Wallpapers.. bionic external pdk bootable frameworks prebuiltsandroid core build Framework gdk sdk icons cts hardware system dalvik libcore tools The.... development libnativehelper S D K device ndk
    • packages Calendar Contacts Gallery2 Launcher2
    • Frameworkbase/core/java/android/app/ActivityManager.javabase/core/java/android/widget/RelativeLayout.javabase/packages/SystemUI/res/*base/core/res/res/*base/core/java/android/os/PowerManager.java
    • sdkbash_completion/adb.bashscreenshot/
    • Compile... You need: •  Ubuntu LTS (10.04) or Mac OS X •  A bunch of tools •  HDD space (~ 30 GB) •  Time (Hours - depending on your HW)
    • Compile... $ source build/envsetup.sh including device/generic/armv7-a-neon/vendorsetup.sh including device/generic/armv7-a/vendorsetup.sh ....
    • Compile... $ lunch Youre building on Linux Lunch menu... pick a combo: 1. full-eng 2. full_x86-eng 3. vbox_x86-eng 4. full_mips-eng 5. full_grouper-userdebug ... Which would you like? [full-eng]
    • zzzzzZZZZZZzzzzzz
    • device mappingscrespo Samsung Nexus Smanta Samsung Nexus 10mako LG Nexus 4grouper / tilapia Asus Nexus 7toro / maguro Samsung Galaxy Nexuswingray Motorola Xoom
    • …zzZZZzz… and run! $ emulator &
    • …zzZZZzz… and run!
    • Architecture by example - GPS Stock Apps User Apps Framework / API Java System Services Dalvik / Runtime / Zygote Libs HAL Init Kernel
    • Architecture by example - GPS Stock Apps User AppslocationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, locationListener);
    • Architecture by example - GPS frameworks/base/location/java/android/location/ LocationManager.java Framework / API System Services try { mService.requestLocationUpdates(request, transport, intent, packageName); } catch (RemoteException e) { Log.e(TAG, "RemoteException", e); }
    • Architecture by example - GPSframeworks/base/location/java/android/location/LocationManager.java Framework / API System Services private final ILocationManager mService;
    • Architecture by example - GPS frameworks/base/location/java/android/location/ ILocationListener.aidl Framework / API System Services void requestLocationUpdates( in LocationRequest request, in ILocationListener listener, in PendingIntent intent, String packageName);
    • Architecture by example - GPS frameworks/base/services/java/com/android/server/ LocationManagerService.java Framework / API System Services LocationProviderInterface provider = mProvidersByName.get(name); ... provider.setRequest(providerRequest, worksource);
    • Architecture by example - GPS frameworks/base/services/java/com/android/server/ location/GpsLocationProvider.java Framework / API System Services private native boolean native_start();
    • Architecture by example - GPS hardware/libhardware/include/hardware/gps.h /** Represents the standard GPS interface. */ typedef struct { int (*init)( GpsCallbacks* callbacks ); /** Starts navigating. */ int (*start)( void ); ... Libs HAL Init
    • Architecture by example - GPS development/tools/emulator/system/gps/ gps_qemu.c device/samsung/manta/gps/gps.exynos5.so Libs HAL Init
    • What’s next? Tips + Tricks•  Level 1: Check source for samples and understanding•  Level 2: Compile your own emulator images•  Level 3: Get a supported nexus device and burn images•  Level 4: Get a development board an build android embedded Software
    • Level 1: grep$ jgrep LocationManager./base/core/java/android/app/ContextImpl.java:60:import android.location.ILocationManager;./base/core/java/android/app/ContextImpl.java:61:import android.location.LocationManager;./base/core/java/android/app/ContextImpl.java:403: return new LocationManager(ctx, ILocationManager.Stub.asInterfa./base/core/java/android/content/Context.java:1749: * <dd> A {@link android.location.LocationManager} for controlling location./base/core/java/android/content/Context.java:1795: * @see android.location.LocationManager./base/core/java/android/content/Context.java:1912: * android.location.LocationManager} for controlling location./base/core/java/android/content/Context.java:1916: * @see android.location.LocationManager./base/core/java/android/provider/Settings.java:3096: * LocationManager service for testing purposes during application deve./base/core/java/android/webkit/GeolocationService.java:23:import android.location.LocationManager;./base/core/java/android/webkit/GeolocationService.java:39: private LocationManager mLocationManager;./base/core/java/android/webkit/GeolocationService.java:54: mLocationManager = (LocationManager) context.getSystemServ./base/core/java/android/webkit/GeolocationService.java:55: if (mLocationManager == null) {./base/core/java/android/webkit/GeolocationService.java:118: if (LocationManager.NETWORK_PROVIDER.equal....
    • Level 1: AndroidXRefhttp://androidxref.com/
    • Level 1: explain-plz @local:/Volumes/android/dalvik $ explain-plz Explanation for folder dalvik: This directory contains the Dalvik virtual machine and core class library, as well as related tools, libraries, and tests. Git project directory: dalvik Git fetch URL: https://android.googlesource.com/platform/dalvik Subfolders with explanation: dexdump dexgen dx opcode-gen tools/hprof-conv vmhttps://github.com/timroes/explain-plz
    • Level 2: ccache$ export USE_CCACHE=1$ export CCACHE_DIR=/<path_of_your_choice>/.ccache$ prebuilts/misc/linux-x86/ccache/ccache -M 50GThe suggested cache size is 50-100G.You can watch ccache being used by doing the following:$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -shttp://source.android.com/source/building.html
    • Level 3
    • Level 4https://android-build.linaro.org/
    • Creditshttp://www.ouya.tv/about/https://mediacenter.motorola.com/Image-Gallery/MOTOACTV-Golf-Edition-8c1.aspxhttp://www.tolino.dehttps://www.honeywellaidc.com/en-US/resources/image-library/Pages/default.aspx?Category=7800&keywords=7800&title=7800&description=7800https://android-build.linaro.org/http://source.android.com/source/building.html
    • DANKE!