File tree Expand file tree Collapse file tree 1 file changed +74
-0
lines changed
Expand file tree Collapse file tree 1 file changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ # 手表定位SDK使用说明(非YhLibraryForAndroid说明)
2+
3+ 标签(空格分隔): 学习
4+
5+ ---
6+
7+ ## 1,环境要求
8+
9+ - AndroidStuido 一台可以上网的电脑 Liunx/mac/windows
10+
11+ ## 2, 项目引入
12+ 当前使用model的bulid.gradle 最后加入 x.x.x为版本号请使用最新稳定版当前编写文档时最新版本1.0.1
13+ ``` java
14+ compile ' org.yh.yhframe:WatchLib:x.x.x'
15+ ```
16+ ## 3,配置
17+ 项目的bulid.gradle
18+ ``` java
19+ allprojects {
20+ repositories {
21+ jcenter()
22+ maven { url " https://jitpack.io" }
23+ }
24+ }
25+ ```
26+ ## 4,百度地图Key配置
27+ ``` JAVA
28+ < ! -- 百度地图Key -- >
29+ < meta- data
30+ android: name= " com.baidu.lbsapi.API_KEY"
31+ android: value= " 你自己的key百度申请" >
32+ ```
33+ ## 5,同步项目
34+ ## 6,新建一个普通的Activiy
35+ 布局就一个Button
36+ 加上点击事件
37+ ``` JAVA
38+ Button ok;
39+ @Override
40+ protected void onCreate(Bundle savedInstanceState)
41+ {
42+ super . onCreate(savedInstanceState);
43+ setContentView(R . layout. activity_main);
44+ ok = (Button ) findViewById(R . id. ok);
45+ ok. setText(" 普通Activity调用" );
46+ ok. setOnClickListener(new View .OnClickListener ()
47+ {
48+ @Override
49+ public void onClick(View view)
50+ {
51+ // SDK调用位置
52+ GlobalUtils . HOME_HOST= " http://115.159.123.101:8085" ;// 接口地址
53+ GlobalUtils . DEIVER_SN = " 123456789012345" ;// SN号
54+ showActivity(Main2Activity . this , LocationActivity . class);
55+ }
56+ });
57+ }
58+
59+ public void showActivity(Activity aty, Class<?> cls)
60+ {
61+ Intent intent = new Intent ();
62+ intent. setClass(aty, cls);
63+ aty. startActivity(intent);
64+ }
65+ ```
66+ ## 7,运行项目完成
67+
68+ ## 8,下面与SDK调用无关
69+ 由于此SDK使用了自己编写的一个开源框架,所以使用此SDK就可以使用本框架的所有功能
70+ 框架地址:里面有使用说明
71+ [ 框架地址] [ 1 ]
72+
73+
74+ [ 1 ] : https://github.com/android-coco/YhLibraryForAndroid
You can’t perform that action at this time.
0 commit comments