Summary of ndroid Enterprise Application Project Development

Source: Internet
Author: User

 

After several Android enterprise application projects, I summarized the basic development steps of the project and hoped to communicate with each other.
I. Application plan:
※Determine the function.
※Required interface and page Jump process.
※The source and format of required data and data.
※Whether server support is required.
※Whether local database support is required.
※Whether special permissions are required.
※Whether background services are required.
Ii. Architecture Design:
※Stratified.
※Network connection.
※Data processing-XML and domain.
※Encapsulate activity.
Three Interface Design:
※The main interface is determined.
※Module interface, list, view, and edit interface.
※Menu, button, dialog box, and prompt information.
※The overall UI color.
Iv. Data Operations and storage:
※Data source.
※Data type.
※Storage method.
5. Business implementation:
※Client service parsing.
Page 6:
※Jump between pages.
※Menus, buttons, and events.

 

 

Keywords: Android app, Android develop, Android Summary

Start the project from 2010.04 to complete the main functional modules, and share the development process and precautions.
Development Environment: Ubuntu7.10 + eclipse 3.5 + SDK
The following is a summary of development:

1.Precautions for source code-based SDK and SDK upgrade

O familiar with how to internationalize Resources

O familiar with how it supports different screen sizes and different density Media

O familiar with its main APIs, the supported lowest version, and the unsupported APIs

O understand its layered architecture

O upgrade SDK

§ Ensure that the platform supports the relevant cglib version (or upgrade UBUNTU)

§ The simple row-tolerant method is remove ~ /. Remove related Android versions and upgrade them.

§ Some resources (for example, % s in strings) may need to be modified to adapt to the new version.

§ Old versions such as 2.01 may not be included in the new SDK

 

2.Emulator & mobile

O use ADB shell to operate emulator

§ Http://www.javaeye.com/topic/260042.

O push/pull file in emulator

§ Eclipse-> window-> show view-> file Explorer-> pull a file from the device (or push a file onto the device)

O use real mobile to connect to USB for Direct Testing (mobile must be set to develop/debug mode)

§ Http://dimitar.me/how-to-connect-your-android-phone-to-ubuntu-to-do-developmenttestinginstallations-or-tethering/.

O emulator is more suitable for performance testing and functional testing. Mobile is more suitable for touch operation testing and real display testing of some views.

O screen size adaptation test (enumeration large, medium, small), screen direction (enumeration horizontal, vertical screen), Task Switching Test

O memory adaptation can only be tested on mobile

 

3.System Configuration items

O sharedpreferences storage location and how to manually modify it on emulator

§ Locate the storage location: \ data \ your package dir \ shared_prefs \ your xml files

§ Follow the above pull/push the file

O SQLite (sqlite3)

§ Default storage location: \ data \ your package dir \ databases \ your database name

§ Perform part of database design and data update based on the above ADB shell operation emulator

§ Design version update and upgrade

O other file I/O

§ File Reading under assert

§ File permissions and read/write

O interpret androidmanifest. xml

§ Application/process ID

§ Activity started at the beginning

§ Form of the activity stack (specify taskaffinity & launchmode = "singletask"), and switch to a new activity in the form of intent. setflags (intent. flag_activity_reorder_to_front)

§ Required permissions

§ Minimum supported versions

 

4.Development Based on view, context, and Manager

O system view & LAYOUT (layout is also a view)

§ Use the view itself to separate layout items.

§ Common view & layout: listview, scrollview, relativelayout, tablelayout

Design commonly used style/theme drawable: http://idunnolol.com/android/drawables.html

§ Common image operations

§ Setcolorfilter)

§ Tailoring

O custom view & layout

§Java code

1.Public classTouchlistviewExtendsListview {PublicTouchlistview (context, attributeset attrs,IntDefstyle ){

2 .}}

§Java code

1.Public classToolbarExtendsLinearlayout {

2.PublicToolbar (FinalContext context ){

3.Super(Context );

4 .}

5.

6.PublicToolbar (FinalContext con, attributeset attrs ){

7 .}

8.

9 .}

 

O application, activity, service, view, intent

§ Relationship between application, activity, service and context

§ Relationship between view and context

§ Use application for global variables between activities, services, and views (better than Singleton)

§ Use intent in factory Mode

§ Do activity jump

§ Sendbroadcast (real-time data exchange with thread + broadcastreceiver)

O windowmanager and packagemanager

 

2.Network I/O

O java.net

O android.net

O org. Apache. HTTP

§ If he is not allowed to operate in asynctask, his timeout setting must be less than 5 seconds (ANR wait time)

§ Java.net.Unknownhostexception

If it occurs in emulator, refer to: http://www.javaeye.com/topic/521023

§ If mobile occurs, it is generally a DNS resolution problem. You can either retry the operation or change the host domain name to public IP address.

 

3.Plotting part

O drawing on The View

§ Add borders only to the original view

§Java code

1. @ override

2.Protected voidDispatchdraw (canvas ){}

 

§ Custom View

§Java code

1. @ override

2.Protected voidOndraw (canvas ){

 

O drawing on bitmap

§Java code

1. Bitmap result = bitmap. createbitmap (48, 48, config. argb_8888 );

2. Canvas canvas =NewCanvas (result );

3 ....

4. Canvas. drawbitmap (result, rect, rect, paint );

 

2.Animation

O Frame Animation

§ Control the detection speed at 25 FPS to make it smoother

O gradient Animation

§ Translation

§ Scaling

§ Rotation

§ Transparency

 

3.ANR

O build a handler for messages and message loop Processing

O use asynctask

 

4.Exception & uncaughtexception

O use uncaughtexceptionhandler

 

5.Introduce third-party jar and share data with other apps

O add third-party jar files by adding user Library

O content provider usage

 

6.Performance Optimization/Optimization 

O view-based optimization http://dl.javaeye.com/topics/download/774b3e9e-1c48-33bd-bc9d-5c27da998181

O Code-level Specification

O Method-level optimization

§ Method profiling (root permission is required if the USB is used to connect to mobile)

O gc Analysis

§ Use allocation Tracker

 

 

 

 

 

 

 

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.