Giter Club home page Giter Club logo

apidemos's Introduction

google官方ApiDemo——完善的Android学习资

基于Android系统源码6.0的ApiDemos,使用Android Studio构建,compileSdkVersion 23,buildToolsVersion "23.0.3",支持 InstantRun

ApiDemo非常全面的介绍了Android开发中常见的Api使用方式。比如Activity、Fragment、Animation、Dialog、OS、Notification、多媒体、图片绘制、NFC、各种view等等,可谓一应俱全! 在阅读源代码过程中,我遇到了很多晦涩难懂的地方。我希望将不明白的地方加上注释,便于在重温的过程中更快找回当时的感觉。我还记得我的初衷是该project的边边角角吃透,写出注释,很久以后当我再次看到这段代码的时候,我能很快知道他是干什么的,我也希望将我的阅读分享出来,供大家批评指正。当然,我更希望越来越多的人加入到这个“阅读”工作中来,添加上你的“阅读心得”,形成一本比较完整的“源代码”教科书。 如下是APIDemo部分截图

主界面

p1

Animation

主要演示了属性动画的特点和使用方法。

p2

App

展示了包括ActionBar、Activity、对话框、fragment、serivice、notification、menue等常见类的使用方法。每一行里面又包含了很多更细节的东西。

p3

Content

主要介绍了Assets、ClipBoard、Packages、Provider和Storage等的使用方法。

p4

Graphics

主要介绍了Canvas、Bitmap、Paint等绘图工具的使用,想了解怎么在canvas上绘制文字、图形等…想要写出优秀的自定义控件的…本章的学习必不可少!

p5

Media

多媒体相关的介绍。

p6

NFC

NFC开发也是越来越流行的,这里应该有你想要的。

p7

OS

主要介绍了Morse Code、Rotation Vector、Sensors和SMS Messaging。

p8

Preference

Android一大重要的持久化存储方式——Preference,本章的介绍非常丰富,几乎涵盖所有。

p9

Text

主要介绍了Linkify、LogTextBox、Marquee的使用方式。

p10

Views

Android原生View的介绍,包括常见的动画、拖拽等操作,常见的Widget的使用方法等。在Android的基础开发中,90%都在和各种各样的View打交道,因此学会这一章所有控件的使用,Android开发基本就入门了!

p11

总结

read the fuck source code!
                  ——linus

apidemos's People

Contributors

aymandf avatar imesong avatar theone10211024 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apidemos's Issues

app启动后闪退,然后抛出TransactionTooLargeException异常.楼主有遇到过同样问题吗?

07-01 12:53:54.463 13027-13027/? I/art: Late-enabling -Xcheck:jni 07-01 12:53:54.492 13027-13027/? D/TidaProvider: TidaProvider() 07-01 12:53:54.532 13027-13027/com.example.android.apis V/SettingsInterface: invalidate [system]: current 912 != cached 0 07-01 12:53:54.533 13027-13027/com.example.android.apis D/ActivityThread: hoder:android.app.IActivityManager$ContentProviderHolder@3eba0787,provider,holder.Provider:android.content.ContentProviderProxy@3cea86b4 07-01 12:53:54.662 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_dependencies_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.670 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_0_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.739 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_1_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.748 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_2_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.754 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_3_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.762 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_4_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.772 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_5_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.788 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_6_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.790 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_7_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.791 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_8_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.817 13027-13027/com.example.android.apis I/art: Open dexFile: /data/app/com.example.android.apis-1/split_lib_slice_9_apk.apk, Fallback to original dex file with InterpretOnly 07-01 12:53:54.825 13027-13027/com.example.android.apis D/ActivityThread: installProvider: context.getPackageName()=com.example.android.apis 07-01 12:53:54.830 13027-13027/com.example.android.apis D/ActivityThread: installProvider: context.getPackageName()=com.example.android.apis 07-01 12:53:54.834 13027-13027/com.example.android.apis D/ActivityThread: installProvider: context.getPackageName()=com.example.android.apis 07-01 12:53:54.837 13027-13027/com.example.android.apis I/InstantRun: starting instant run server: is main process 07-01 12:53:54.839 13027-13027/com.example.android.apis D/ActivityThread: installProvider: context.getPackageName()=com.example.android.apis 07-01 12:53:54.842 13027-13027/com.example.android.apis D/ActivityThread: installProvider: context.getPackageName()=com.example.android.apis 07-01 12:53:54.869 13027-13027/com.example.android.apis V/ActivityThread: Handling launch of ActivityRecord{1832607f token=android.os.BinderProxy@813f84c {com.example.android.apis/com.example.android.apis.ApiDemos}} 07-01 12:53:54.887 13027-13027/com.example.android.apis V/ActivityThread: ActivityRecord{1832607f token=android.os.BinderProxy@813f84c {com.example.android.apis/com.example.android.apis.ApiDemos}}: app=com.example.android.apis.ApiDemosApplication@1f82a5aa, appName=com.example.android.apis, pkg=com.example.android.apis, comp={com.example.android.apis/com.example.android.apis.ApiDemos}, dir=/data/app/com.example.android.apis-1/base.apk 07-01 12:53:54.908 13027-13027/com.example.android.apis D/ApiDemos: ╔════════════════════════════════════════════════════════════════════════════════════════ 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ║ Thread: main 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ╟──────────────────────────────────────────────────────────────────────────────────────── 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ║ Activity.performCreate (Activity.java:6034) 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ║ ApiDemos.onCreate (ApiDemos.java:49) 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ╟──────────────────────────────────────────────────────────────────────────────────────── 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ║ apidemos onCreate path == 07-01 12:53:54.909 13027-13027/com.example.android.apis D/ApiDemos: ╚════════════════════════════════════════════════════════════════════════════════════════ 07-01 12:53:54.911 13027-13189/com.example.android.apis W/ResourcesManager: Asset path '/system/framework/gson.jar' does not exist or contains no resources. 07-01 12:53:54.911 13027-13189/com.example.android.apis W/ResourcesManager: Asset path '/system/framework/volley.jar' does not exist or contains no resources. 07-01 12:53:54.941 13027-13027/com.example.android.apis E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! 07-01 12:53:54.941 13027-13027/com.example.android.apis D/AndroidRuntime: Shutting down VM 07-01 12:53:54.942 13027-13027/com.example.android.apis E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.android.apis, PID: 13027 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.apis/com.example.android.apis.ApiDemos}: java.lang.RuntimeException: Package manager has died at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2470) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532) at android.app.ActivityThread.access$900(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5562) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763) Caused by: java.lang.RuntimeException: Package manager has died at android.app.ApplicationPackageManager.queryIntentActivitiesAsUser(ApplicationPackageManager.java:576) at android.app.ApplicationPackageManager.queryIntentActivities(ApplicationPackageManager.java:562) at com.example.android.apis.ApiDemos.getData(ApiDemos.java:72) at com.example.android.apis.ApiDemos.onCreate(ApiDemos.java:51) at android.app.Activity.performCreate(Activity.java:6034) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532)  at android.app.ActivityThread.access$900(ActivityThread.java:169)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5562)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)  Caused by: android.os.TransactionTooLargeException at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:504) at android.content.pm.IPackageManager$Stub$Proxy.queryIntentActivities(IPackageManager.java:2514) at android.app.ApplicationPackageManager.queryIntentActivitiesAsUser(ApplicationPackageManager.java:570) at android.app.ApplicationPackageManager.queryIntentActivities(ApplicationPackageManager.java:562)  at com.example.android.apis.ApiDemos.getData(ApiDemos.java:72)  at com.example.android.apis.ApiDemos.onCreate(ApiDemos.java:51)  at android.app.Activity.performCreate(Activity.java:6034)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2532)  at android.app.ActivityThread.access$900(ActivityThread.java:169)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5562)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)  07-01 12:53:54.951 13027-13027/com.example.android.apis I/Process: Sending signal. PID: 13027 SIG: 9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.