Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

Android Package Structure Best Practice


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The main goal of packaging your classes is to simplify the navigation through your source code. This is especially important for open source applications. In my opinion, a easy-to-navigate package structure includes the following packages:

com.example.main - contains your main driver functions, such as your main activity(s), your application class (if you have one), etc

com.example.conf - contains your configuration files, such as those containing constants (static final variables)

com.example.net - network-related classes, such as those that make http requests

com.example.util - utility classes, such as services, BroadcastReceivers, or other background processes


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...