Mobile platform Job--weather forecast--Get weather data--Apply for Baidu AK code for application

Source: Internet
Author: User

Demand:

Cities to switch

Real-time updates (buttons or gestures or drop-down refreshes)

Realistic future weather in the 3rd

Does not limit the horizontal screen or vertical screen, does not limit the layout style, but requires the data to be displayed (Beijing, weather data, weather icons)

Tips:

Get real-time weather data (any option)

JSON data Format

http://api.map.baidu.com/telematics/v3/weather?location= Shanghai &output=json&ak=hxwagbscc9utkbo5v5qglwz9

This code: Copy of I am exhausted, the results can not be visited. Got drunk.

If you can try to get the teacher's meta ppt file,

Access that Code

See if we can get weather data.

So it is more reliable to apply for yourself.

Detailed methods are described below:

First Login

Http://developer.baidu.com/map/index.php?title=lbscloud

Find the Application key in the Little blue Word section

Figure one: Application for secret key

Figure II: Application Page

and click Create app, app type select Android SDK

Figure III: Type selection

Security code consists of: signature + Package name

There are two ways to get a signature: the first one is too troublesome, give a second, and you get the first and troublesome way to obtain it in this article.

The simple way:

Open Eclipse's Android development tool.

Window->preferences->android->build

Figure Eight: Get a stupid fingerprint

The signature has, next is the package name, has done the Android schoolmate, must know how obtains the package name. So we're going to create our job next.

Figure Nine: Package name

Nature is the part behind the package.

Figure 10: Submission Interface

Note here that in the security code: the signature and the package name are in English case: +;+ link.

So you get an ak number.

Figure 11: Get the AK number.

However, I do not apply to the use of ...

I don't know which one to use to request the weather. I got a message like this:

Figure 12: Access failure

The first method of obtaining

Enter the DOS command line.

Figure IV: Entering the DOS command line

Then enter directly : CD. Android

( in fact, I think there may be a problem here, but I found that as long as you have used,android has done a few programs, there will be such a generated folder, so as long as the input is OK.) I also have these files under this folder )

Figure V: Rest assured typing

So, be sure to enter this command with confidence.

Input command:keytool-list-v-keystore debug.keystore

The following will pop up: "Enter the KeyStore Password:" (or enter keystore Password: etc.) Six:

Figure VI: Entering the keystore password

Because we are doing Android Development, so the secret key is android(PS: You type, you will not see any traces, so be assured of daring to knock down that 7 Letters, and then press ENTER on it, for: Error presentation and correct presentation, began to press a lot of keys, found no response, directly press the carriage return, and then the exception. )

Figure VII: a stupid fingerprint

So get SHA1 fingerprints

As for why the red, I do not know. The original post is marked red ~ ~ ~ ~

If there is unclear where to look at this URL:

Http://developer.baidu.com/map/index.php?title=androidsdk/guide/key

To get more detailed configuration information.

Mobile platform Job--weather forecast--Get weather data--Apply for Baidu AK code for application

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.