- 博客(18)
- 收藏
- 关注
原创 MaterialDesign: NavigationView
1.NavigationView implementation 'com.android.support:design:26.1.0'<android.support.design.widget.NavigationView android:layout_width="match_parent" android:layout_height="match_par
2018-02-13 16:04:25
218
原创 MaterialDesign:ToolBar & DrawerLayout
1.ToolBar<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_pa
2018-02-13 15:44:29
254
原创 Service
Service 与 Activity 通信 class DemoService extends Service{ private DemoBinder mDemoBinder=new DemoBinder(); @Nullable @Override public IBinder onBind(Intent intent
2018-02-13 14:32:08
235
原创 多线程:AsyncTask
/** * @param Params... Void 传入后台任务的参数,此处为不传参数 * @param Progress Integer 进度单位 * @param Result Boolean 返回值类型 */ class DemoTask extends AsyncTask<Void,Integer,Boolean>{
2018-02-13 13:48:33
184
原创 JSON解析:
1.JSONObject// JSON demo[{"id":"1","version":"4","name":"a"},{"id":"2","version":"5","name":"b"},{"id":"3","version":"6","name":"c"}] try{ JSONArray jsonArray=new JSONArray(json
2018-02-13 13:23:54
250
原创 XML解析:pull & SAX
1.pull解析apps> // xml Demo <app> <id>1</id> <name>node1</name> <version>1</version> </app> <app> <id>2</id> <name>node2</name> <v
2018-02-13 12:57:55
201
原创 网络技术:WebView & HttpURLConnection & OkHttp
1.WebView <uses-permission android:name="android.permission.INTERNET"/> WebView mWeb=(WebView) findViewById(R.id.webview); mWeb.getSettings().setJavaScriptEnabled(true); mW
2018-02-13 12:24:07
437
原创 播放多媒体文件:MediaPlayer & VideoPlayer
1.播放音频:MediaPlayer MediaPlayer mediaPlayer=new MediaPlayer(); mediaPlayer.setDataSource(path); mediaPlayer.prepare(); mediaPlayer.start();2.播放视频:VideoPlayer VideoV
2018-02-13 11:56:38
651
原创 照片Uri转path
if(Build.VERSION.SDK_INT >=19){ if(DocumentsContract.isDocumentUri(this,uri)){ String totalId=DocumentsContract.getDocumentId(uri); if("com.android.providers
2018-02-12 22:08:10
650
原创 获取File的Uri
1.注册provider<provider android:authorities="xxx" android:name="android.support.v4.content.FileProvider" android:exported="false" android:grantUriPermissio
2018-02-12 21:41:23
2473
原创 Notification 显示大图和长文本
notification.setStyle(new NotificationCompat.BigTextStyle().bigText("xxxxx")).build();notification.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap)).build();
2018-02-12 20:58:33
2161
原创 组件: ContentProvider
1.创建providerpublic class DemoProvider extends ContentProvider { public static final int DEMO_DIR=0; public static final int DEMO_ITEM=1; public static final String AUTHORITIES="com.demo.pro
2018-02-12 20:41:23
188
原创 数据存储: SQLite
1.创建SQLiteDatabase @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DemoSQlite dem
2018-02-12 19:34:33
253
原创 数据存储:openFileOutput & sharedPreferences
1.文件存储 openFileOutput(String filename,int mode) 存储在 /data/data/<packagename>/files/..2.SharedPreferences存储Context: getSharedPreferences(filename,MODE_PRIVATE) // 存储在 /data/data/<package
2018-02-12 18:40:52
334
原创 Git
1.配置身份及查询git config --glocal user.name "me"git config --glocal user.email "A@me.c"2.创建代码仓库cd aa/bb/<package name>git init3.查看仓库中文件ls -al4.提交代码 git add . git commit -m "some mark"
2018-02-12 16:44:16
215
原创 组件 :normal & ordered & local Broadcasts
1.动态broadcastpublic class MainActivity extends AppCompatActivity { DemoReceiver demoReceiver; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInst
2018-02-12 16:30:03
258
原创 RecyclerView的实现与滑动删除
1.添加依赖 implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support:recyclerview-v7:26.1.0'2.新建实例类与Adapterpublic class DemoAdapter extends RecyclerView.Adapter<D
2018-02-12 16:07:19
256
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人