AndroidSDK开发步骤

本文介绍了一个公司为接入手环而开发SDK的过程,包括工程搭建、依赖管理、代码混淆、jar包生成及最终打包等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

某个公司要接入我们公司的手环,需要我们提供一个sdk。真正开发时间大概也就两周时间吧,下面来说说步骤。

1.新建一个工程,主工程是demo(各种测试按钮界面),再新建一个module工程(jlsportsdk,真正的sdk工程)。

2.module工程jlsportsdk中也引用了其他jar包,这些jar包要通过provided的方式引用,否则生成的jar包里会带有引用jar包的pom,最终导致使用者添加jar包时冲突。

3.混淆:这一步我搞了1天,总是报各种错误,总的原则就是暴露给用户调用的类不混淆,其他的都要混淆。混淆规则大家可以自己在网上搜,这里说说我遇到的一个坑。jlsportsdk里有一个listener,里面有一个方法getAlarm(ArrayList<Alarm>),在demo的Activity里实现了这个listener,运行时一直说我没有实现这个方法,在网上找了很久,后来才知道由于默认混淆了泛型,所以一直识别不了这个方法。。在混淆规则文件中加上-keepattributes Signature就好了。

4.生成jar包:运行程序,jlsportsdk工程下会自动生成jar包。在jlsportsdk目录下的build/outputs/arr下,有个arr文件,把后缀名改为.zip,解压后根目录有个classes.jar,这个就是生成的jar包

5.打包:我们需要把jlsportsdk工程删除(这个是源码,不能给别人看,给别人看的是生成的jar包),然后将生成的jar包放入主工程下。这个工程就是我们最终提供出去的。

如果内容对您有帮助,请打赏我吧,您的支持是我更新的最大动力!

扫码关注我吧:

[14本经典Android开发教程]-3-Android SDK 中文开发文档 什么是 Android? Android 是一个专门针对移动设备的软件集,它包括一个操作系统,中间件和一些重要的应用程序。Beta版的 Android SDK 提供了在Android 平台上使用JaVa语言进行Android应用开发必须的工具和API接口。 特性 · 应用程序框架 支持组件的重用与替换 · Dalvik 虚拟机 专为移动设备优化 · 集成的浏览器 基于开源的WebKit 引擎 · 优化的图形库 包括定制的2D图形库,3D图形库基于OpenGL ES 1.0 (硬件加速可选) · SQLite 用作结构化的数据存储 · 多媒体支持 包括常见的音频、视频和静态图像格式 (如 MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) · GSM 电话技术 (依赖于硬件) · 蓝牙Bluetooth, EDGE, 3G, 和 WiFi (依赖于硬件) · 照相机,GPS,指南针,和加速度计(accelerometer) (依赖于硬件) · 丰富的开发环境 包括设备模拟器,调试工具,内存及性能分析图表,和Eclipse集成开发环境插件 Android 架构 下图显示的是Android操作系统的主要组件。每一部分将会在下面具体描述。 已上传2本: [14本经典Android开发教程]-1-Android开发从入门到精通http://download.youkuaiyun.com/detail/cleopard/8355245 [14本经典Android开发教程]-2-Android开发手册—API函数详解 http://download.youkuaiyun.com/detail/cleopard/8374487 剩余11本稍后上传!@或直接从这里寻找@ http://download.youkuaiyun.com/user/cleopard/album @更多@ http://cleopard.download.youkuaiyun.com/ 福利 http://xuemeilaile.com 17份软件测试文档 http://download.youkuaiyun.com/album/detail/1425 13份WPF经典开发教程 http://download.youkuaiyun.com/album/detail/1115 C#资料合辑二[C#桌面编程入门篇] http://download.youkuaiyun.com/album/detail/957 C#资料合辑一[C#入门篇] http://download.youkuaiyun.com/album/detail/669 [Csharp高级编程(第6版)](共8压缩卷) http://download.youkuaiyun.com/album/detail/667 10个[精品资源]Java学习资料合辑[一] http://download.youkuaiyun.com/album/detail/663 10个C#Socket编程代码示例 http://download.youkuaiyun.com/album/detail/631 6份GDI+程序设计资源整合[全零分] http://download.youkuaiyun.com/album/detail/625 2014年移动游戏行业数据分析 http://download.youkuaiyun.com/detail/cleopard/8340331 一文读懂2014年全球互联网广告新生态 http://download.youkuaiyun.com/detail/cleopard/8340303
List of Sample Apps The list below provides a summary of the sample applications that are available with the Android SDK. Using the links on this page, you can view the source files of the sample applications in your browser. You can also download the source of these samples into your SDK, then modify and reuse it as you need. For more information, see Getting the Samples. API Demos A variety of small applications that demonstrate an extensive collection of framework topics. Backup and Restore A simple example that illustrates a few different ways for an application to implement support for the Android data backup and restore mechanism. Bluetooth Chat An application for two-way text messaging over Bluetooth. BusinessCard An application that demonstrates how to launch the built-in contact picker from within an activity. This sample also uses reflection to ensure that the correct version of the contacts API is used, depending on which API level the application is running under. Contact Manager An application that demonstrates how to query the system contacts provider using the ContactsContract API, as well as insert contacts into a specific account. Home A home screen replacement application. JetBoy A game that demonstrates the SONiVOX JET interactive music technology, with JetPlayer. Live Wallpaper An application that demonstrates how to create a live wallpaper and bundle it in an application that users can install on their devices. Lunar Lander A classic Lunar Lander game. Multiple Resolutions A sample application that shows how to use resource directory qualifiers to provide different resources for different screen configurations. Note Pad An application for saving notes. Similar (but not identical) to the Notepad tutorial. SampleSyncAdapter Demonstrates how an application can communicate with a cloud-based service and synchronize its data with data stored locally in a content provider. The sample uses two related parts of the Android framework — the account manager and the synchronization manager (through a sync adapter). Searchable Dictionary A sample application that demonstrates Android's search framework, including how to provide search suggestions for Quick Search Box. Snake An implementation of the classic game "Snake." Soft Keyboard An example of writing an input method for a software keyboard. Spinner A simple application that serves as an application-under-test for the SpinnerTest sample application. SpinnerTest An example test application that contains test cases run against the Spinner sample application. To learn more about the application and how to run it, please read the Activity Testing tutorial. TicTacToeLib An example of an Android library project that provides a game-play Activity to any dependent application project. For an example of how an application can use the code and resources in an Android library project, see the TicTacToeMain sample application. TicTacToeMain An example of an Android application that makes use of code and resources provided in an Android library project. Specifically, this application uses code and resources provided in the TicTacToeLib library project. Wiktionary An example of creating interactive widgets for display on the Android home screen. Wiktionary (Simplified) A simple Android home screen widgets example.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猴子学编程

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值