Giter Site home page Giter Site logo

android-official-doc-learn's Introduction

Android Official Docs Learn

Android开发的一些代码示例,来自官方Training文档的实现以及一些探索性实验。

测试环境:Android Studio 2.1API 14-23

Demo List

  1. My First App
  • Intent示例,启动另一个activity并在其中显示之前输入的文本
  • Key Words: Intent, onClick, putExtra, startActivity, parentActivityName, getIntent.
  • Starting Another Activity
  • 简单的生命周期示例,需要使用DDMS来查看日志
  • Key Words: onCreate, onStart, onResume, onRestart, onPause, onStop, onDestory, onSaveInstanceState, onRestoreInstanceState.
  • Managing the Activity Lifecycle
  • Fragment基础示例,使用Fragment显示标题和正文
  • Key Words: Fragment, FrameLayout, FragmentTransaction, getSupportFragmentManager, addToBackStack.
  • Building a Dynamic UI with Fragments
  • 使用SQLite数据库的SQLiteOpenHelper示例,不包括使用PreferencesFiles,说明DaoBeanDBHelper较好的例子
  • Key Words: BaseColumns, SQLiteOpenHelper, ContentValues, moveToFirst, getColumnIndex, getReadableDatabase, getWritableDatabase, setEnabled.
  • Saving Data in SQL Databases
  • 使用Intent与应用交互:拨号
  • Key Words: Intent, ACTION_DIAL, packageManager, startActivityForResult, RESULT_OK, RESULT_CANCELLED, intent-filter, Uri, setResult.
  • Interacting with Other Apps
  • 系统权限使用示例,由于Android 6.0要求,需在运行时请求权限,部分参考官方文档代码
  • Key Words: uses-permission, checkSelfPermission, shouldShowRequestPermissionRationale, RequestPermissions, onRequestPermissionsResult.
  • Working with System Permissions
  • 内容分享示例,在读写存储空间时有必要在运行时声明和请求系统权限,功能包括输入和分享文本,设置压缩图片结果并支持分享,通过调用浏览器查询IP地址位置,学习更多关于Intent内容如intent-filter,action,category,data:scheme,mimeType等,同时也是使用Android Studio分渠道打包示例
  • Key Words: uses-permission, checkSelfPermission, shouldShowRequestPermissionRationale, RequestPermissions, onRequestPermissionsResult, getPickImageIntent, getImageResized, decodeBitmap, getRotationFromGallery, getRotationFromCamera, startActivityForResult, requestCode, resultCode, onBackPressed, setData, putExtra, addCategory, finish
  • Apps with Content Sharing
  • 帧动画示例,顺序,倒序,停止动画demo
  • Key Words: AnimationDrawable, getDrawable, setImageResource, animation-list, android:oneshot
  • Animation List-CSDN
  • 支持局域网超大文件上传的Nanohttpd,可置于android,需模拟multipart/form-data上传文件,应用部分太多,不列举.
  • Key Words: Nanohttpd, upload, json, wifimanager...
  • Nanohttpd
  • TranslateAnimation动画Demo,点击按钮实现图像位置的变换
  • Key Words: TranslateAnimation, setInterpolator, setDuration, setFillAfter, startAnimation
  • TranslateAnimation
  • 长按跑马灯Textview弹出PopupWindow气泡支持文本复制(默认API > 11,因此不作版本代码控制),实现横竖屏切换后销毁PopupWindow且跑马灯捕获焦点继续滚动,首次点击返回键(onKeyDown, onBackPressed, onTouch并不能捕获)后销毁PopupWindow
  • Key Words: PopupWindow, setSelected(true), setTouchable(true), setFocusable(true), setOutsideTouchable(true), setBackgroundDrawable(new ColorDrawable(0x00000000)), showAsDropDown, onConfigurationChanged, onLongClick, onTouch
  • StackOverflow popupWindow Dismiss
  • Android事件分发机制
  • 点击事件返回值
  • onLongClickListener事件处理
  • 根据官方文档使用二维码扫码库zxing构建QRCode Scanner应用,根据调研学习深度,进行多次迭代简化
  • Key Words: zxing
  • 如何快速Build:
    • 0.从github上clone下整个zxing项目
    • 1.将android目录导入android studio(eclipse-->android studio项目转换)
    • 2.在build.gradle文件加上依赖库compile 'com.google.zxing:core:3.3.0'或者,从官网wiki页进入Just Need a Jar选择需要的版本(如3.3.0)和类型(如只包含源码、包含文档bleh),放入lib文件夹并Add as library
    • 3.如果你的项目编译不通过,而缺少CameraConfigurationUtils类的话,在android-core里,把它复制过来放在包com.google.zxing.client.android.camera下面。    - 4.如果你的项目因为一些不必要的ResultHandler方法不存在,请注释掉方法调用和该类,如ISBN之类的,因为你可能并不需要全家桶    - 5.大象装进了冰箱
  • Zxing github
  • zxing official wikis

License: MIT license (MIT)

android-official-doc-learn's People

Contributors

sennhvi avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

rohitnotes

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.