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

1_App Inventor初步

powerhope
August 11, 2016
190

1_App Inventor初步

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 服务器地址
  2. College of Mathematics and Computer Science, Hunan Normal University 信息技术革命历程

    大机器时代 1946~1970’s 微机时代 1970~2000’s 移动时代 2000~
  3. College of Mathematics and Computer Science, Hunan Normal University 

    App Inventor 是一种在线的软件开发工具。 这种工具可以使用户更容易的为Android智 能手机编写应用程序。  特点:“拼软件”,即通过拖放图形化的 组件和代码块,将这些代码放在一起,结 果产生一个应用程序(App)。 什么是App Inventor
  4. College of Mathematics and Computer Science, Hunan Normal University 

    App Inventor 原是Google实验室(Google Lab)的一 个子计划,由一群Google工程师和勇于挑战的Google使 用者共同参与。  App Inventor于2010年12月15日正式公开发布,团队 由 Hal Abelson和Mark Friedman领导。  在2011年下半年,谷歌发布源代码,终止其服务器,将 该项目移交给麻省理工学院(MIT)移动学习中心,由 MIT的Hal Abelson教授和他的同事Eric Klopfer和 Mitchel Resnick教授领导继续开发。2012年3月MIT版 本的App Inventor推出并开放使用。  在2013年12月,MIT发布了App Inventor 2。 App Inventor发展
  5. College of Mathematics and Computer Science, Hunan Normal University 

    IEEE理事、ACM理事   MIT MacVicar教师理事之一   1995 IEEE Taylor L. Booth奖   2012 ACM SIGCSE奖   1980 Logo编程语言   1982 《Turtle Geometry》 •几何学教学和学习方法的革命性改变   1984《计算机程序的结构与解释》(SICP) •计算机程序设计经典书籍 •在全世界范围计算机教育界形成了极为重要的影响   自由软件运动的发起人和倡导者。 •自由软件基金会(Free Software Foundation)董事 •Creative Commons的发起和领导者 Harold (Hal) Abelson教授
  6. College of Mathematics and Computer Science, Hunan Normal University 

    操作系统  Macintosh(使用Intel处理器): Mac OS X 10.5或更高版 本。  Windows: Windows XP, Windows Vista, Windows 7。  GNU/Linux: Ubuntu 8或更高版本, Debian 5或更高版本。 注: GNU/Linux live开发,在计算机和Android设备之间仅 支持WiFi连接。 系统要求
  7. College of Mathematics and Computer Science, Hunan Normal University 

    浏览器  Mozilla Firefox 3.6或更高版本。  Apple Safari 5.0或更高版本。  Google Chrome 4.0或更高版本。  Microsoft Internet Explorer不支持。  模拟器  Phone或 Tablet或emulator(模拟器)。  Android Operating System 2.3 或更高版本。 系统要求
  8. College of Mathematics and Computer Science, Hunan Normal University 

    用AI2构建应用时,有三种可选择的方式设置实时 测试 http://appinventor.mit.edu/explore/ai2/setup. html  使用安卓设备和无线网络进行开发  没有安卓设备,安装并运行AI2模拟器  没有WiFi,使用USB数据线和安卓设备开发 App Inventor开发环境配置
  9. College of Mathematics and Computer Science, Hunan Normal University 

    需要在安卓设备上下载和安装“MIT App Inventor Companion app”  可以通过扫描“Google Play Store” 或“Apk文 件” 二维码下载安装。  此外,也可以直接通过地址 http://appinv.us/xAI2cf34下载Apk文件,然后 安装到安卓设备。 使用安卓设备和无线网络进行开发
  10. College of Mathematics and Computer Science, Hunan Normal University 

    注:1、如果你的安卓设备不能使用二维码扫描, 也可以直接到Google Play Store搜索“MIT AI2 Companion”,然后安装。  2、如果直接使用Apk安装,请将安卓设备设置为 允许安装“未知来源”,在Android4.0以前版本 通过“设置”—>“应用”—>“未知来源”设置 。在Android4.0或之后版本通过“设置”—>“安 全”—>“未知来源”设置。 使用安卓设备和无线网络进行开发
  11. College of Mathematics and Computer Science, Hunan Normal University 

    将计算机和安卓设备连接到同一无线网络。  登录服务器。打开网站http://app.gzjkw.net登录 ,并打开应用。  在 “连接【Connect】”菜单中选择“AI Companion【AI伴侣】”  然后弹出二维扫描对话框,在你的安卓设备中启动 安装好的“MIT App Companion”应用。然后单 击“Scan QR code”按钮扫描浏览器中的二维码 。 使用安卓设备和无线网络进行开发
  12. College of Mathematics and Computer Science, Hunan Normal University 

    如果你的App没有出现在案作安卓设备上,最可能 原因如下:  安卓设备上配套安装的App Inventor Companion App已经过期,请从AI2网站下载最新的 Companion App。  安卓设备没有连接到无线网络,确认在安卓设备上 AICompanion App屏幕下方显示了IP地址。  安卓设备和计算机没有连接到同一无线网络。  你的学校或组织可能不允许无线网络连接协议。 问题排除
  13. College of Mathematics and Computer Science, Hunan Normal University 

    使用第二种和第三种连接方式,首先需要安装 JAVA和配置环境变量。
  14. College of Mathematics and Computer Science, Hunan Normal University 

    下载Java Development Kit (JDK)。 http://www.java.com 安装Java运行环境
  15. College of Mathematics and Computer Science, Hunan Normal University 接下来的工作就是安装提示一步一步走。设置环境变量步骤

    如下:  我的电脑->属性->高级->环境变量->系统变量中添加以 下环境变量:  JAVA_HOME值为: C:\Program Files\Java\jdk1.7.0_03(你安装JDK的目录)  CLASSPATH值为: .;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;  Path: 在开始追加 “;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin 安装Java运行环境
  16. College of Mathematics and Computer Science, Hunan Normal University 

    简单设置,在Path后加入: C:\Program Files\Java\jdk1.7.0_03\bin 安装Java运行环境
  17. College of Mathematics and Computer Science, Hunan Normal University 

    安装完成后测试是否配置成功  依次单击“开始”->开始菜单最下方的“搜索程 序和文件”,键入“cmd”,然后在搜索结果对话框 选择选择“CMD.exe”,在打开的命令符提示窗口 键入命令“javac” 安装Java运行环境
  18. College of Mathematics and Computer Science, Hunan Normal University 

    下载软件包( http://appinv.us/aisetup_windows)  下载完成后,要以Windows 7的管理员的权限进行 安装。 安装“App Inventor 2 Setup” 软件包
  19. College of Mathematics and Computer Science, Hunan Normal University 

    安装完成后,在桌面或“开始”—>“所有程序” 中启动“aiStarter”。 启动“aiStarter”
  20. College of Mathematics and Computer Science, Hunan Normal University 

    登录服务器。打开网站 http://ai2.appinventor.mit.edu 或国内的服务器 http://app.gzjkw.net。  创建一个App Inventor项目,任意选择一个组件放 在工作面板中。  从“连接【Connect】”中选择“模拟器【 Emulator】”,启动模拟器。 打开App Inventor项目和连接到模 拟器
  21. College of Mathematics and Computer Science, Hunan Normal University 

    浏览器会弹出一个“连接中…【Connecting…】 ”对话框 连接到模拟器
  22. College of Mathematics and Computer Science, Hunan Normal University 

    接着在启动过程中,会检查你的模拟器中的伴侣程 序是否过期,如果不是最新的版本系统会提示你“ 伴侣程序已过期,……” 连接到模拟器
  23. College of Mathematics and Computer Science, Hunan Normal University 

    出现如下界面时,把屏幕切换到模拟器界面,选择 “确定【OK】”按钮,接着单击“安装【Install】 连接到模拟器
  24. College of Mathematics and Computer Science, Hunan Normal University 

    然后再次返回到网页,单击“升级完成”,AI伴侣 程序会自动在模拟器中启动,并将你的App下载到 模拟器并运行 连接到模拟器
  25. College of Mathematics and Computer Science, Hunan Normal University 

    步骤1:在计算机上安装Java和“App Inventor 2 Setup”软件包,详细过程见第二种方法步骤1和2。  步骤2:下载和安装“MIT App Inventor Companion app”,详细过程见第一种方法步骤1。  步骤3:启动“aiStarter”。  步骤4:在安卓设备上设置USB连接(打开“USB调试” )。在安卓设备的“设置”—>“开发者选项”中,确保 “USB调试”是允许的。在Android3.2或以前版本的设备上 ,可以通过“设置”—>“应用”—> “开发者选项”进 行设置。 使用USB数据线和安卓设备开发
  26. College of Mathematics and Computer Science, Hunan Normal University 

    步骤5:连接计算机和安卓设备,要使用USB将安 卓设备连接到计算机使用,确保设备连接作为一个 “大规模存储设备”(不是“媒体设备”),此外还可能需 要安装安卓设备驱动和停止其它手机助手软件。  步骤6:测试连接  打开你的AI2项目,然后选择“连接【Connect 】”中的“USB”,连接你的安卓设备。 使用USB数据线和安卓设备开发
  27. College of Mathematics and Computer Science, Hunan Normal University 

    启动AI2后,如果你登录的帐号还没有创建任何项 目,开发环境会进入到项目管理界面 App Inventor 2界面
  28. College of Mathematics and Computer Science, Hunan Normal University 

    项目管理界面,主要可以完成项目的新建、删除、 导入、导出、删除、保存等功能。 项目管理界面
  29. College of Mathematics and Computer Science, Hunan Normal University 

    设计界面主要由7大部分组成。  (1)导航菜单  (2)工具菜单  (3)组件面板  (4)工作面板  (5)组件列表  (6)组件属性  (7)素材 设计界面
  30. College of Mathematics and Computer Science, Hunan Normal University 

    块编辑器主要由5大部分组成。  (1)工具菜单  (2)模块窗口  (3)抽屉:从(1)中选择某个的模块后,弹出抽 屉,显示对应模块的命令、事件和赋值等。  (4)素材  (5)工作面板 块编辑器
  31. College of Mathematics and Computer Science, Hunan Normal University 

    命令模块是执行某一组件的行为 命令模块(深紫色)
  32. College of Mathematics and Computer Science, Hunan Normal University 

    赋值模块用于取得组件的属性值和对组件属性的重 新赋值。分两种类型,一种是取值模块,一种是重 新赋值模块。 赋值模块(深绿色)
  33. College of Mathematics and Computer Science, Hunan Normal University 

    代码块中的下三角符号 代码块的操作方法
  34. College of Mathematics and Computer Science, Hunan Normal University 

    代码块左上角的蓝色正方形 代码块的操作方法
  35. College of Mathematics and Computer Science, Hunan Normal University 

    淡粉色小正方形 代码块的操作方法
  36. College of Mathematics and Computer Science, Hunan Normal University 

    右键单击不同的模块的弹出菜单,可以复制代码块 、添加注释、折叠代码块、禁用代码块、删除代码 块和跨屏复制代码等。 代码块的操作方法
  37. College of Mathematics and Computer Science, Hunan Normal University 

    代码搜索功能  在代码工作面板直接输入关键字进行搜索代码  组件搜索时关键字输入要根据你添加的组件的名称 进行输入;内置块的搜索时,如果是在中文版本需 要输入中文关键字,如“如果、循环、绝对值”, 如果是在英文版本需要输入英文关键字,如“if、 each、abs”。 代码块的操作方法
  38. College of Mathematics and Computer Science, Hunan Normal University 

    Gallery是App Inventor集成用来分享你的应用( 包括源文件)和探索别人的APP源码。你可以一键 分享你的应用到Gallery,一键便可以打开其它人分 享的应用并去重新修改它。 Gallery
  39. College of Mathematics and Computer Science, Hunan Normal University 

    http://app.gzjkw.net(国内服务器)  http://ai2.appinventor.mit.edu/ (MIT服务器 )需要谷歌邮箱验证,可能访问不了  http://appinventor.mit.edu/ (官方资源)  本课程网址: http://oldmc.hunnu.edu.cn/appinventor AI2主要资源
  40. College of Mathematics and Computer Science, Hunan Normal University 

    湖南师范大学瞿绍军老师 http://pan.baidu.com/s/1jGDxt46密码:qrw3  2015年7月CS4HS湖南师范大学App Inventor师 资培训班资源下载: http://pan.baidu.com/s/1mgIRHna  浙江大学城市学院吴明晖老师 http://pan.baidu.com/s/1gdEeB4J  edX在线课程 https://www.edx.org/course/mobile- computing-app-inventor-part-1-trinityx- t002x AI2主要资源
  41. College of Mathematics and Computer Science, Hunan Normal University 

    搭建好实验环境,熟悉AI2的主要界面和代码块的 操作方法。 实验一