Day 7 part 1, androidpart

Source: Internet
Author: User

Day 7 part 1, androidpart

Day 7 part 1, getting started with Piggy's Android

Android data storage and access-Files

---- Reprinted with the source: coder-pig



This section introduces:


Before starting a new day, integrate what we learned in the previous six days.

Day 1: Background Knowledge of android, platform architecture and related features, and Development Environment Construction

Day 2: a preliminary understanding of the four major components, the life cycle of the app, the understanding of the app project directory, and the development of simple phone Dialers,

Six major la s and three tips; nine sisters 9 patch work to make partial scaling Materials

Day 3: some basic UI components commonly used by Android

Day 4: android event processing mechanism: Based on Event listening and callback, Handler information transmission mechanism; android touch event

Configuration responds to the events set by the system, and AyyncTask asynchronous tasks implement simpler UI thread operations.

Day 5: Basic Program unit of android-related concepts of Activity, life cycle, data exchange between multiple activities, four different loading modes

Activity Fragment: Fragment concept, lifecycle, static and dynamic loading of Fragment, Fragment and Activity

Interaction, Fragment management and transactions

Day 6: the Core of the Android Application-Intent (Intent) concept, explicit Intent and implicit Intent, the seven attributes of Intent, the system predefines and

Custom implicit Intent

If you have finished learning in the last six days, you can deploy some simple apps. You can create a custom UI to implement some clicks.

Page jump! Well, if we want to make a simple notebook, I believe that everyone is making their own interface, but actually writing

Stuff in, thoseWhere to save information? We seem to only learn how to write Bundle data in Intent putExtras (), but if

What if we re-open the software next time? Everything I wrote earlier is gone! So we need somePersistent StorageSome of our data methods,

For example, we save the data to a file or a database! I believe that you are already a bit

I want to try it out. Now, let's start learning about android data storage and access for a day!




This section describes the road map:





Body:



File Operations for Android:









Android file read/write:



Sample Code:

:



After running, check File Exploer to see that the corresponding file already exists in data/<package name>/File:



In addition, click the corresponding icon in the upper right corner to export the file to the computer:



Download reference code:Click to download





Read and Write files on the SD card:



Sample Code:

:


After running, go to the SD card directory and you can see:

Indicates that the file is successfully generated!




Download reference code:Code download





SD card problems:

Debugging on a real machine is usually possible, but there are a lot of problems with the virtual machine, and we will use it before.

Environment. getExternalStorageState (). equals (Environment. MEDIA_MOUNTED) may always return false

That is, the SD card does not exist. This is the main problem. Now, all the new sdks are creating AVD

Apply for a storage area of an SD card at the same time


You may need to manually associate the SD card with the old sdk version or for other reasons. The settings are as follows:


① Find the path of the created avd image:

Click to open the avd interface and click detail to view the directory of the avd image.




② Go to the path where the avd image is located and copy the path of sdcard. img:

For example, my:-sdcard C: \ Users \ Administrator \. android \ avd \ Jay4.2.avd \ sdcard. img



③ Click the following interface:


Apply the following and Run it!







Music lovers: We recommend over 10 well-selected songs

10 in total

Encore une Fois: trs.shsmu.edu.cn/fy/song/1.mp3

Il y a trop de gens qui t aiment 202.101.116.24/qq168/200601_14321883776.mp3

The first two songs were from Italian actress hélè ne Segara, with a soft and round voice.

Sunshine: friends.chyangwa.com/kelly/song2/Sunshine.mp3
The English KEANE album Hopes and Fears is optimistic and lyrical.

It s not good bye: www.zy1696.com/mp/sample/11.mp3

La Solitudine: balinda.bbs.net/..new.
The song from Laura Pausini, Italy's chief female, shows a clear and lyrical style.

Reality: www.22sea.com/app_music/reality #
The film's first kiss is ending with richard sanderson, the singer. The song is lyrical and optimistic.

How do I live: dheart.com/yhgs/dsswan/03.mp3
Leann rimes, the final song in the air prison, has a tender and beautiful song style.

The blower's daughter:... the remaining full text>

200: A film (or classic) that can be learned over and over again )!

I personally think:
If you want to improve your English learning through English Content in movies. Similar textbooks are available both in bookstores and on the Internet. The movie courses are very classic!

We recommend you to download it online. Www.verycd.com/topics/2722851/

The main content of the teaching material is:
Chapter 1 history and genre movie history and types
Chapter 2 character and performance roles and performances
Chapter 3 narrative description
Chapter 4 style
Chapter 5 critical perspectives comment
Chapter 6 blockbuster film (the matrix) file: hacker empire
Chapter 7 comedy film (forrest gump) comedy: A ganzheng Chuan
Chapter 8 social drama film (american beauty) social problem film: american beauty
Chapter 9 action film (the bond films) action film: 007 series movies
Chapter 10 film noir/neo-noir (se7en) Black movie and new black movie: Seven Sins
Chapter 11 romance film :( the english patient) Love film: British patient
Chapter 12 gangster film (the godfather) black band: godfather
Chapter 13 war film (apocalypse now) war film: Modern Revelation
Chapter 14 horror film (the shining) horror film: shining
Chapter 15 science fiction film (2001: a space odyssey) science fiction film: 2001: roaming space

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.