Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2_1_HelloPurr
Search
powerhope
August 11, 2016
0
130
2_1_HelloPurr
App Inventor移动应用开发
powerhope
August 11, 2016
Tweet
Share
More Decks by powerhope
See All by powerhope
1_App Inventor初步
powerhope
0
190
2_2_8-Ball(魔术8球)
powerhope
2
120
3_App Inventor编程基础
powerhope
0
100
4_组件-用户界面
powerhope
0
140
5_组件-界面布局
powerhope
0
140
6_组件-多媒体
powerhope
0
89
7_组件-绘图动画
powerhope
0
110
8_组件-传感器
powerhope
0
120
9_组件-社交应用
powerhope
0
140
Featured
See All Featured
BBQ
matthewcrist
80
8.8k
Practical Orchestrator
shlominoach
182
9.7k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Documentation Writing (for coders)
carmenintech
60
3.9k
Clear Off the Table
cherdarchuk
84
310k
Building Adaptive Systems
keathley
31
1.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
Automating Front-end Workflow
addyosmani
1356
200k
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Why Our Code Smells
bkeepers
PRO
331
56k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
Transcript
College of Mathematics and Computer Science, Hunan Normal University 瞿绍军
湖南师范大学数学与计算机科学学院
College of Mathematics and Computer Science, Hunan Normal University
服务器网址 ◦ http://ai2.appinventor.mit.edu/ ◦ http://app.gzjkw.net 资源 ◦ http://appinventor.mit.edu/ 网址
College of Mathematics and Computer Science, Hunan Normal University
当你触摸这只猫时,它会发出“喵呜”声和手 机震动;当你摇晃它时,也将发出声音。 HelloPurr,你好猫猫
College of Mathematics and Computer Science, Hunan Normal University
用Chrome (谷歌浏览器) 打开了App Inventor 主 页http://ai2.appinventor.mit.edu或 http://app.gzjkw.net 用你的电子邮件地址账号注册和登录 登录服务器
College of Mathematics and Computer Science, Hunan Normal University 新建项目
College of Mathematics and Computer Science, Hunan Normal University
项目名称只能由字母、数字或下划线组成,且大小 写敏感,名称中间不能包含空格,如“Hello”和 “hello”是两个不同的项目名 新建项目
College of Mathematics and Computer Science, Hunan Normal University
增加按钮。在“组件面板”的“用户界面”中拖动 “按钮”到“工作面板”下的“Screen1”。 界面设计
College of Mathematics and Computer Science, Hunan Normal University
上传猫的图片和声音 界面设计
College of Mathematics and Computer Science, Hunan Normal University
修改按钮的属性 在“组件属性”窗口中修改“图像”和“文本”两 个属性。 “图像”属性下面的“kitty.png” 。 “文本”属性里面原有的内容“按钮1文本”删除 掉。 界面设计
College of Mathematics and Computer Science, Hunan Normal University 界面设计
College of Mathematics and Computer Science, Hunan Normal University
增加标签 在“组件面板”的“用户界面”中拖动“标签”到 “工作面板”下的“Screen1”,用鼠标选定添加 的“标签1”,在“组件属性”窗口中修改“背景 颜色”为品红,“字号”大小为32,“文本”中输 入“Pet the kitty!”。 界面设计
College of Mathematics and Computer Science, Hunan Normal University 界面设计
College of Mathematics and Computer Science, Hunan Normal University
增加音效 在“组件面板”的“多媒体”中拖动“音效”到“ 工作面板”下的“Screen1”,无论把它放在哪里 ,它都会出现在预览窗口的底部,并被标记为“非 可视组件【Non-visible components】”。 非可视组件在应用中发挥特定作用,但不会显示在 用户界面中。 然后用鼠标选定添加的“音效1”,在“组件属性 ”窗口中为属性“源文件”选择声音文件 “meow.mp3”。 界面设计
College of Mathematics and Computer Science, Hunan Normal University 界面设计
College of Mathematics and Computer Science, Hunan Normal University
打开块编辑器,即逻辑设计 添加组件行为
College of Mathematics and Computer Science, Hunan Normal University
添加按键来播放刚添加声音 添加组件行为
College of Mathematics and Computer Science, Hunan Normal University
可以参考上节内容连接你的测试设备。这里用模拟 器测试结果。 测试应用
College of Mathematics and Computer Science, Hunan Normal University
当点击按钮时,让猫咪发出叫声和让手机震动。 添加震动效果
College of Mathematics and Computer Science, Hunan Normal University
在“调用 音效1.震动”块的右下角写着“毫秒数【 millisecs】”。块上的开放插槽表示需要插入其他 块,来设定行为的具体方式。 添加震动效果
College of Mathematics and Computer Science, Hunan Normal University
最后单击数字“0”,输入新值“500” 添加震动效果
College of Mathematics and Computer Science, Hunan Normal University
测试:试试吧!点击设备上的按钮,你不仅会听到 猫叫声,还会感觉到半秒的设备震动。 注意:测试震动效果只能在安卓设备上进行,模拟 器上无法测试。 测试
College of Mathematics and Computer Science, Hunan Normal University
添加加速度传感器 摇晃手机
College of Mathematics and Computer Science, Hunan Normal University
添加事件处理程序 摇晃手机
College of Mathematics and Computer Science, Hunan Normal University 摇晃手机
College of Mathematics and Computer Science, Hunan Normal University
如果你想把应用分享给朋友或发布到应用市场,就 需要把应用打包成apk文件。AI2提供了二种打包方 式。 打包apk并显示二维码 打包apk并下载到电脑 打包和下载应用
College of Mathematics and Computer Science, Hunan Normal University 打包apk并显示二维码
College of Mathematics and Computer Science, Hunan Normal University 打包apk并下载到电脑
College of Mathematics and Computer Science, Hunan Normal University
apk文件下载下来后,默认保存在当前操作系统的 用户文档中的“Downloads【下载】”目录下面。 然后可以将apk文件分享给其他人。 打包apk并下载到电脑
College of Mathematics and Computer Science, Hunan Normal University
参照HelloPurr设计动物世界。要求使用几种动物 ,当点击或触摸某个动物时,动物发出对应的叫声 ,至少用4种动物,然后发布你的应用。 实验二