机智云开源APP基础修改教程(Android)-Arduino中文社区 - Powered by Discuz! Archiver

小鹏鹏 发表于 2019-5-7 11:41

机智云开源APP基础修改教程(Android)

本文主要介绍机智云APP(或机智云自主开发平台的APP代码包)的基础开发步骤,包括:APP名称、启动图和操作界等,让APP展示成为自主定义界面的APP。如需对机智云Demo APP进行全局改动,请参考《27个免费视频教你学安卓APP开发》。


[ 准备工作] 首先打开个人项目
https://img-blog.csdn.net/20180608100852299?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      把Product Secret复制下来,接下来是我定义的数据点
https://img-blog.csdn.net/20180608101047816?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      点击应用配置——添加新应用
https://img-blog.csdn.net/20180608101234123?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70填好名称,选择Android,点击添加
https://img-blog.csdn.net/20180608101329109?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      点击应用开发,选择Android,填入Product Secret,点击生成代码包
https://img-blog.csdn.net/20180608101456596?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70点击下载
https://img-blog.csdn.net/20180608101628282?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
下载下来的是一个压缩文件,因为楼主能力有限,身为一个电气的学生没有正儿八经的去学过Java和Android,所以只研究了一下下Android Studio的简单操作,如果有Android大神可以进一步开发,这个个人感觉还是比较适合跟我一样的小白。然后我们选择Android Studio文件夹,并把它复制到G盘根目录(这个无所谓,放那个盘都可以)
Android Studio下载安装地址www.android-studio.org/JDK下载安装地址www.oracle.com/technetwork/java/javase/downloads/index.html(百度有教程)
再接下来,去千图网等网站下载一个logo和一个启动页,
https://img-blog.csdn.net/20180608123041427?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
    然后用PS进行处理,启动页的尺寸是1242*2208https://img-blog.csdn.net/20180608123132372?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70处理完是这个样子https://img-blog.csdn.net/20180608123354907?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      logo是96*96的,背景最好透明
https://img-blog.csdn.net/20180608123435797?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70处理完是这样https://img-blog.csdn.net/20180608123505417?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      现在准备工作都做完了,开始改代码
[ 改代码--启动图]
      打开Android Studio,选择第二项打开已经存在的项目,然后选择路径(解压的那个文件夹)https://img-blog.csdn.net/20180608123812775?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70打开项目之后切换到工程视图https://img-blog.csdn.net/20180608123946266?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      把刚才处理好的图片复制粘贴到drawable-xhdpi目录下
https://img-blog.csdn.net/20180608124137314?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
https://img-blog.csdn.net/2018060812422169?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70 先来更换启动图,找到下图的目录文件AndroidManifest.xml的第70行,按住Ctrl,鼠标左击@style/My Start
https://img-blog.csdn.net/2018060812445847?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70然后自动进入style.xml目录下,找到第60行,按住Crtl,鼠标左击@drawable/backgroundhttps://img-blog.csdn.net/20180608124651185?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70 跳转到background.xml文件,修改第7行的路径为我们制作并粘贴到工程下的welcome.png,只需更改上文件名即可
https://img-blog.csdn.net/20180608124916440?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70启动图就算改完了,接下来改logo,还是AndroidManifest.xml文件,找到第64行https://img-blog.csdn.net/20180608125312997?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70同样的修改文件名换成我们自己制作的图片https://img-blog.csdn.net/20180608125240970?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70这样logo也改好了,然后我们改APP设备名前面的小图标,首先找到GosDeviceListActivity.java,然后找到第113行,按住Ctrl,鼠标左击GosDeviceAdapterhttps://img-blog.csdn.net/20180608125426904?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70跳转到 GosDeviceAdapter.java后找到第65行,按住Ctrl,鼠标左击item_gos_device_listhttps://img-blog.csdn.net/20180608125820805?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70 这时跳转到item_gos_device_list.xml下,点击视图左下角的Texthttps://img-blog.csdn.net/20180608125948185?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

      点击右侧的Preview

https://img-blog.csdn.net/20180608130032929?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70

这时就出来了已连接设备时的视图,双击右侧黄色的图标,代码自动定位到这一部分,修改路径为我们的logo路径https://img-blog.csdn.net/20180608130111406?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      这样,设备的图标也改好了
https://img-blog.csdn.net/20180608130254353?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70最后我们更改监控界面,找到GosDeviceControlActivity.java,然后找到第93行,按住Ctrl,左击activity_gos_device_controlhttps://img-blog.csdn.net/20180608130511256?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      跳转到监控界面
https://img-blog.csdn.net/20180608130653380?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70双击对应的监控项名称,代码自动跳转,修改text项为中文名称https://img-blog.csdn.net/20180608130744589?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      最后效果如下
https://img-blog.csdn.net/20180608130847131?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70 打开手机的USB调试,并连接电脑https://img-blog.csdn.net/20180608131056512?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      点击视图上方的运行
https://img-blog.csdn.net/20180608131202401?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70选择手机,点击OK,代码编译完之后自动安装到手机
https://img-blog.csdn.net/20180608131216681?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      看一下咱们做的APP的效果,开启虚拟设备,设置几个值,推送一下
https://img-blog.csdn.net/20180608132040604?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70https://img-blog.csdn.net/20180608132245116?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70      APP没问题,最后一步,把APP导出,点击Build——Generate Signed APKhttps://img-blog.csdn.net/20180608132434729?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70 点击Create Newhttps://img-blog.csdn.net/20180608132603621?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      选择jks存放的路径
https://img-blog.csdn.net/20180608132847325?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
填写其他信息,点击OKhttps://img-blog.csdn.net/20180608132906966?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
      点击Next
https://img-blog.csdn.net/20180608132955450?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
点击finish,APP就导出到你刚才指定的路径了https://img-blog.csdn.net/20180608133948700?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3RpY2hpbWkzMzc1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
页: [1]
查看完整版本: 机智云开源APP基础修改教程(Android)