Android Development Project: The Call of Baidu Map
In an unfamiliar environment, getting your own location, choosing the right place to eat, accommodation and bus routes becomes a challenge. This practice project is to solve the above problems, by invoking the interface of Baidu map to achieve positioning, query bus routes, find suitable catering and accommodation functions, to meet people's travel function.
A demand analysis
1.1 Customer needs
The development of a project, first of all to understand the needs of customers, otherwise this project does not have any value for development. In the rapid development of society today, people circulate faster, choose the right transportation routes, restaurants and accommodation become a problem, so according to customer needs, to develop appropriate projects to meet customer needs.
1.2 Functional Requirements
Before the project is developed, the functionality needs to be analyzed. The functions that a project needs to implement, and the relationships between features and what functions are implemented.
1.3 Performance requirements
After the project development is completed, whether it can be installed on various physical machines, and to achieve the expected functionality.
1.4 Scalability Requirements
In the future, with the increase of customer demand, the project can be well expanded to achieve more functions.
Two-system design
2.1 Android Baidu map system module design.
Call Baidu Map needs a total interface and through the summary surface call four sub-modules, respectively, there are positioning function module, bus route query module, destination query module, other functional modules. As shown in the following:
Third, the system realization
3.1 The implementation of the system requires the authorization of Baidu map. The first application key, after the application key need to obtain the rights of Baidu in Androidmanifest.xml:
<uses-permission android:name="Android.permission.BAIDU_LOCATION_SERVICE" >
</uses-permission>
Because the system will run on different screens, it is necessary to adapt to different screens, leaving the user with a good experience to implement the way:
<supports-screens
android:anydensity="true"
android:largescreens="true"
android:normalscreens="false"
android:resizeable="true"
android:smallscreens="true" />
3.2 Implementation of the Baidu map calls the main class of the common energy as shown in the following table:
Locationclient |
Locating the Client |
Locationmode |
Positioning mode |
Bitmapdescriptor |
User-defined positioning icons |
Mapview |
Show a view of a map |
Buslinesearch |
City Bus Query |
Poisearch |
Point of Interest query |
Suggestionsearch |
Suggested queries |
Baidumap |
Baidu Map Call |
3.3 Due to the use of the Baidu API version is not recently provided by the company, so it can only run on Android 4 system.
Four-system testing
4.1 Positioning of the test
Test the function of the design according to the shape of the transform positioning icon
4.2 Bus Query Test
When the input can not find the results will be automatically prompted
Bus route map appears when input is correct
4.3 Location Enquiry
When the input location is not found
When you enter the correct location and name
After testing we can find that the design of the system basically meet the requirements.
Five summary
5.1 Problems encountered in the development process and solutions
1. Build the Android Studio environment. Started in the Android studio to build Baidu map development environment, has been prompted to import. jar package is not correct, look for some Android studio configuration Baidu Map Environment mode. I've tried it all and it's still not true, and eventually I give up Android Studio software for development. The software for this project was developed using the Eclipse software provided by Zeng Junhong.
2, online has a lot of Android Baidu Map development tutorial, but I learn from them to do the project, the first one big problem they import. jar package Many can not be found, using the current. jar package, to write tutorials to the code will be problematic. So it's important to find a suitable. jar package. And the Android version they offer is relatively low, although there are problems with the eclipse hint, but the problem quickly disappears. If we import the program into a virtual machine or a physical machine, the software we import will automatically exit and not work properly.
3, in the Baidu Map Development Center Application key also appeared some problems, there may be the application of key in the project is not working. You must enter the correct Eclipse hash value and create the project package name at the time of application. Otherwise can not be adjusted out of the map of Baidu maps or pull out of the graphics do not meet the needs of the project.
5.2 Project deficiencies and improvement plans
1), in this project, the implementation of a number of functional modules, but not effective integration in an interface, giving a feeling of a more chaotic interface.
2), many sub-interface functions coincide, a great waste of resources. The need for code integration and optimization to optimize the system, so that users are more willing to accept.
3) program hosting in open source China. (Forever Q2).
5.3 Sentiment
Learned a lot of useful things throughout the course
1, in the study of the knowledge of the summary is a very important thing. That is able to summarize the knowledge of the previous paragraph and understand what they have mastered, but also for the next stage of learning to make reasonable arrangements to improve the efficiency of learning.
2, knowledge to keep learning, the stronger the desire to learn more can stimulate their desire to study. Lou Teacher is my good example, to the teacher to learn more.
3, in the last week, the teacher's speech, I am deeply inspired, only learn more to grasp the knowledge to find their own interests and hobbies, in the work can have more choices.
4, in this short two months, from the teacher here to learn a lot of knowledge, in the future graduate students will be conducive to their own study. Unfortunately, there is no learning tool that teachers give us, and JAVA and Android cannot be used flexibly.
5, the study time arrangement is unreasonable, has the fear thought, the main reason is the university lazy thought, still retains, will overcome in the later study.
6, in the future graduate students hope to follow Lou teachers to learn, and improve their ability.
Android Practice project Summary (edit)