I. Project ISSUES
1. Banner Auto-scroll, when banner is not visible, switch multiple times FRAGMENT,FCCause: A conflict between system componentsevasion: 1) Auto-scroll when banner is visible2) Stop auto-scrolling when banner is not visible Lazy Load Lazyloadrefer to List13.java in Apidemosteps to resolve:1) Monitor the scroll events of the ListView 2) Non-manual, and automatic scrolling is visibleww.23code.com 2. Layout event Penetrationscenario: When using framelayout or cascading layouts, if there is no control somewhere in the upper layout,User Click events are propagated to the lower levelSolution: two. Project function1. Collection (browsing history)Analysis1) Favorites: Details page Menu2) View: In Favorite clips3) Cancel: Details page MenuDesignData Persistence1) internalstorage/data/data/packagename/files2) Externalstoragesdcard/mnt/sdcard/Scenario: File larger game packet picture cache3) Sharepreferences/data/data/packagename/share_prefsscenario: Small, key-value pair form user settings
4) SQLite/data/data/packagename/databasesScenario: Large data volume, similar data structure, frequent increase/deletion/change/checkContacts, text messages, pictures, audio, video5) WebURLScenario: Users can view on any device Category:1) Service side2) Client Review:SQLite Use steps1) Inherit Sqliteopenhelper2) Create helper, helper.getwritabledatabase ()3) db.execsql (SQL)db.rawquery () relational databaseObject Oriented4) ORM Object Relational Mapping
Db.insert ()
Db.delete ()db.update ()db.query () 2. ORM FrameworkOrmliteGreendaoactiveandroid 3. Steps to use the Activeandroid library:1) Create application, initialize Activeandroid 2) Create a class that inherits the model and sets a mapping to the database table name and column name3) Save data with Save () method4. Activeandroid More Methods1) Delete2) Check3) Modify4) BULK Insert 5) Set the file name and version number of the database all IO operations are time-consuming 5. Collection function1) Writing Database operations tool classes2) in the Details page menu click on the event call3) Pass the story object to the details page from the list fragment 6. Cancel Collection1) Add a method to delete a collection database in Dbmanager2) Increase the number of ways to determine if a piece of data exists in the database3) Add a way to toggle the collection State4) Call on the details page 7. Repeatedly inserting deleted issues using the same objectSymptom: Failed to insert data after second timecause: Activeandroid does not support multiple insertions of the same objectFIX: Using cloned objectsrewrite the Clone () method of the story class FAQ1. Using activeandroid, no parameterless construction method was added when creating model constructor: Construction MethodExperience:Android Development Learning has been 3 months, from which has learned a lot, there are a lot of do not understand, today is mainly used in the database, the database is also previously learned SQLite, to the database of additions and deletions to be compared to the familiar, data persistence of several commonly used. No matter in that project all need to use the database, before I do the QQ music player, also need the database to save the data and modify. What is needed today is to be aware of the need to persist data in daily collections. To cancel a collection is to delete the data, when the deletion will encounter a common problem is that if there is no data, you delete the project will appear to run errors. Now in the advanced stage it feels like every day is really more than a day. Need to digest daily knowledge points, accumulate more than two days on a lot of knowledge points can not digest. Android learning is endless and a lot of it is necessary to persist in accumulating.
Android Knowledge Daily Development