Professional Documents
Culture Documents
http://forum.laptrinhdidong.vn/showthread.php?t=96
Help
Register
Forum
What's New?
Forum Actions Quick Links Advanced Search
Forum
Lp Trnh Di ng
Lp trnh Android
Results 1 to 4 of 4
10-24-2011, 10:16 AM
#1
nhdac
Moderator
u tin cc bn phi xc nh 2 v tr trn a ca 2 tp tin sau: Keytool ca Java: N nm trong folder Java/bin (ni cc bn ci t Java vo my), nu cc bn ci t Java theo kiu mc nh th n nm th mc sau: C:\Program Files\Java\jdk1.7.0\bin. Debug.keystore ca Android: Theo mc nh trong my mnh th n nm : C:\Users\WIN7\.android (l ni cha cc my Virtual Device). Tip theo cc bn vo Command Line. Khi mi vo th thng thng cc bn s thy mc nh nh sau:
1 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
Sau cc bn g dng lnh sau : keytool.exe -v -list -alias androiddebugkey -keystore "C:\Users \WIN7\.android\debug.keystore" -storepass android -keypass android
2 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
Vy khi g xong cu lnh trn th bn s nhn c m s MD5 ng k Map key (M s dng nh : 94:1E:43:49:87:73:BB:E6:A6:88 7:20:F1:8E:B5:98 ). Tip theo cc bn vo trang web http://code.google.com /android/maps-api-signup.html v nhp ci MD5 ca bn vo :
Tip theo cc bn s nhn c kt qu dng nh: Key Android: zxcvbnmsadfghjlkqwpoeirty MD5: 94:1E:43:49:87:73:BB:E6:A6:88 7:20:F1:8E:B5:98 test: <com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey=" zxcvbnmsadfghjlkqwpoeirty" />
3 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
Cc bn lu kt qu ny li vo 1 trang notepad hay word g v k t y v sau mi khi cn dng ng dng map th bn ch cn copy c ci on test trn vo phn layout l xong (c th thm vi thuc tnh nu bn thch). V tip theo mnh s to 1 ng dng minh ha v MapView: Project : Project name: TestMap2 Build Target: Google APIs platform 2.2 Application name: TestMap2 Package name: com.dac Create Activity: TestMap2Activity Cc bn lu l khi mun s dng cc th vin ca google v Map th cc bn phi to target ca Project l Google APIs v to target ca Virtual Devices tng ng. Cc bn thm uses-permission v uses-library vo file AndroidManifest.xml nh sau: PHP Code:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.andro id.com/apk/res/android" package="com.dac" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <usespermission android:name="android.permission.I NTERNET"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <useslibrary android:name="com.google.android.maps "/> <activity android:label="@string/app_name" android:name=".TestMap2Activity" > <intent-filter > <action android:name="android .intent.action.MAIN" /> <category android:name="andro id.intent.category.LAUNCHER" />
4 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
android:text="Nobilomo@gmail.com" /> <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" > <Button android:id="@+id/btnZoomOut" android:layout_width="wrap_conten t" android:layout_height="wrap_conte nt" android:text="-" /> <Button android:id="@+id/btnSat" android:layout_width="wrap_conten t" android:layout_height="wrap_conte nt"
import com.google.android.maps.*; public class TestMap2Activity extends MapActi vity { OnClickListener o = new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stu b MapView mv = (MapView)findViewByI d(R.id.MapView); switch (v.getId()) { case R.id.btnZoomIn: mv.getController().zoomIn(); break; case R.id.btnZoomOut: mv.getController().zoomOut(); break; case R.id.btnSat: mv.setSatellite(true);
5 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
Today, 11:08 AM
#2
handsome89
Junior Member
anh oi giup em voi em bi loi nay khong biet sua the nao bay h error.jpg tks anh nhieu.
Today, 11:11 AM
#3
handsome89
Junior Member
6 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
em khong sao up dc cai nh n to hn c na..sory cc anh trn din n by h em b li ny THE APPLICATION MAPVIEW(PROCESS COM.DAC) HAS STOPPED UNEXPECTEDLY. PLEASE TRY AGAIN mong cac anh ch dy em iu ny.
Today, 04:38 PM
#4
van.le
Junior Member
hi bn! sau khi ng k key map th ta s b on code nhn v u vy bn? trong layout/main.xml afh ?
Quick Navigation
Lp trnh Android
Top
7 of 8
2/27/2012 11:01 PM
http://forum.laptrinhdidong.vn/showthread.php?t=96
All times are GMT +7. The time now is 10:58 PM. Powered by vBulletin Version 4.1.7 Copyright 2012 vBulletin Solutions, Inc. All rights reserved.
8 of 8
2/27/2012 11:01 PM