[Android] shares a complete project, suitable for beginners !, New to android

Source: Internet
Author: User

[Android] shares a complete project, suitable for beginners !, New to android

Before I wrote this app, I read an article in toutiao.com: http://www.manager#.com/post/155110. after all, I want to skip this kind of app so that I can use mobile phone computing. So you can start the process without thinking too much.

The project uses three open-source packages: one is image loading: https://github.com/nostra13/Android-Universal-Image-Loader usage: 1. initialize in onCreate of Appliction
/*** Initialize imageLoader */public void initImageLoader () {File cacheDir = StorageUtils. getCacheDirectory (getApplicationContext (); ImageLoaderConfiguration config = new ImageLoaderConfiguration. builder (getApplicationContext ()). memoryCache (new LruMemoryCache (5*1024*1024 )). memoryCacheSize (10*1024*1024 ). discCache (new UnlimitedDiscCache (cacheDir )). discCacheFileNameGenerator (new HashCodeFileNameGenerator ()). build (); ImageLoader. getInstance (). init (config);} public DisplayImageOptions getOptions (int drawableId) {return new DisplayImageOptions. builder (). showImageOnLoading (drawableId ). showImageForEmptyUri (drawableId ). showImageOnFail (drawableId ). resetViewBeforeLoading (true ). cacheInMemory (true ). cacheOnDisc (true ). imageScaleType (ImageScaleType. EXACTLY ). bitmapConfig (Bitmap. config. RGB_565 ). build ();}

2. Call during use:

ImageLoader.getInstance().displayImage(avatarUrl,holder.mImage,MyApplication.getInstance().getOptions(R.drawable.user_icon_default_main),new SimpleImageLoadingListener() {@Overridepublic void onLoadingComplete(String imageUri,View view, Bitmap loadedImage) {super.onLoadingComplete(imageUri, view, loadedImage);}});
One is pull-down Refresh: https://github.com/johannilsson/android-pulltorefresh usage:
// Set PullToRefreshmListView. setMode (Mode. BOTH); mListView. setOnRefreshListener (new OnRefreshListener2 <ListView> () {// drop-Down Pulling Down @ Overridepublic void onPullDownToRefresh (PullToRefreshBase <ListView> refreshView) {String label = DateUtils. formatDateTime (MainAct. this, System. currentTimeMillis (), DateUtils. FORMAT_SHOW_TIME | DateUtils. FORMAT_SHOW_DATE | DateUtils. FORMAT_ABBREV_ALL); refreshView. getLoadingLayoutProxy (). setLastUpdatedLabel (label); mListView. setMode (Mode. BOTH); pullFromUser = true; mRefreshType = RefreshType. REFRESH; pageNum = 0; lastItemTime = getCurrentTime (); // get the data fetchData ();} // Pulling Up @ Overridepublic void onPullUpToRefresh (PullToRefreshBase <ListView> refreshView) {// Add mRefreshType = RefreshType when pulling up. LOAD_MORE; // get the data fetchData () ;}}); actualListView = mListView. getRefreshableView (); actualListView. setFastScrollEnabled (true); mEntities = new ArrayList <RankEntity> (); mAdapter = new MainListAdapter (MainAct. this, mEntities); actualListView. setAdapter (mAdapter); if (mEntities. size () = 0) {fetchData ();} mListView. setState (State. RELEASE_TO_REFRESH, true );

  

One is the wizard process: https://github.com/TechFreak/WizardPager this source package has been modified, only use the single choice of this Fragment! Although the project is a waste of new ideas, it is out of the idea of an instant. After the development is complete, I feel bored and I have more than 40 choices, click to get cramps! Then an automatic page flip switch is added!
Apk download: QQ: 471497524: 519659991 new exchange group, welcome developers in Guangzhou to join: http://jq.qq.com /? _ Wv = 1027 & k = cgvXpA. In addition, an HR team in the group needs to find an android team who has more than one year of work experience and can develop apps independently, if you are looking for a job, you must add this group with the final attachment:

 

Related Article

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.