Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2_1_HelloPurr

powerhope
August 11, 2016
130

 2_1_HelloPurr

App Inventor移动应用开发

powerhope

August 11, 2016
Tweet

Transcript

  1. College of Mathematics and Computer Science, Hunan Normal University 

    服务器网址 ◦ http://ai2.appinventor.mit.edu/ ◦ http://app.gzjkw.net  资源 ◦ http://appinventor.mit.edu/ 网址
  2. College of Mathematics and Computer Science, Hunan Normal University 

    当你触摸这只猫时,它会发出“喵呜”声和手 机震动;当你摇晃它时,也将发出声音。 HelloPurr,你好猫猫
  3. College of Mathematics and Computer Science, Hunan Normal University 

    用Chrome (谷歌浏览器) 打开了App Inventor 主 页http://ai2.appinventor.mit.edu或 http://app.gzjkw.net  用你的电子邮件地址账号注册和登录 登录服务器
  4. College of Mathematics and Computer Science, Hunan Normal University 

    项目名称只能由字母、数字或下划线组成,且大小 写敏感,名称中间不能包含空格,如“Hello”和 “hello”是两个不同的项目名 新建项目
  5. College of Mathematics and Computer Science, Hunan Normal University 

    增加按钮。在“组件面板”的“用户界面”中拖动 “按钮”到“工作面板”下的“Screen1”。 界面设计
  6. College of Mathematics and Computer Science, Hunan Normal University 

    修改按钮的属性  在“组件属性”窗口中修改“图像”和“文本”两 个属性。  “图像”属性下面的“kitty.png” 。  “文本”属性里面原有的内容“按钮1文本”删除 掉。 界面设计
  7. College of Mathematics and Computer Science, Hunan Normal University 

    增加标签  在“组件面板”的“用户界面”中拖动“标签”到 “工作面板”下的“Screen1”,用鼠标选定添加 的“标签1”,在“组件属性”窗口中修改“背景 颜色”为品红,“字号”大小为32,“文本”中输 入“Pet the kitty!”。 界面设计
  8. College of Mathematics and Computer Science, Hunan Normal University 

    增加音效  在“组件面板”的“多媒体”中拖动“音效”到“ 工作面板”下的“Screen1”,无论把它放在哪里 ,它都会出现在预览窗口的底部,并被标记为“非 可视组件【Non-visible components】”。  非可视组件在应用中发挥特定作用,但不会显示在 用户界面中。  然后用鼠标选定添加的“音效1”,在“组件属性 ”窗口中为属性“源文件”选择声音文件 “meow.mp3”。 界面设计
  9. College of Mathematics and Computer Science, Hunan Normal University 

    打开块编辑器,即逻辑设计 添加组件行为
  10. College of Mathematics and Computer Science, Hunan Normal University 

    添加按键来播放刚添加声音 添加组件行为
  11. College of Mathematics and Computer Science, Hunan Normal University 

    可以参考上节内容连接你的测试设备。这里用模拟 器测试结果。 测试应用
  12. College of Mathematics and Computer Science, Hunan Normal University 

    当点击按钮时,让猫咪发出叫声和让手机震动。 添加震动效果
  13. College of Mathematics and Computer Science, Hunan Normal University 

    在“调用 音效1.震动”块的右下角写着“毫秒数【 millisecs】”。块上的开放插槽表示需要插入其他 块,来设定行为的具体方式。 添加震动效果
  14. College of Mathematics and Computer Science, Hunan Normal University 

    最后单击数字“0”,输入新值“500” 添加震动效果
  15. College of Mathematics and Computer Science, Hunan Normal University 

    测试:试试吧!点击设备上的按钮,你不仅会听到 猫叫声,还会感觉到半秒的设备震动。  注意:测试震动效果只能在安卓设备上进行,模拟 器上无法测试。 测试
  16. College of Mathematics and Computer Science, Hunan Normal University 

    如果你想把应用分享给朋友或发布到应用市场,就 需要把应用打包成apk文件。AI2提供了二种打包方 式。  打包apk并显示二维码  打包apk并下载到电脑 打包和下载应用
  17. College of Mathematics and Computer Science, Hunan Normal University 

    apk文件下载下来后,默认保存在当前操作系统的 用户文档中的“Downloads【下载】”目录下面。 然后可以将apk文件分享给其他人。 打包apk并下载到电脑
  18. College of Mathematics and Computer Science, Hunan Normal University 

    参照HelloPurr设计动物世界。要求使用几种动物 ,当点击或触摸某个动物时,动物发出对应的叫声 ,至少用4种动物,然后发布你的应用。 实验二