android复习题

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:18   2310   0

1获取定位的方式:(gps) ;(network)

2 activity状态(画图)生命周期

3安卓的框架linux

4 dalvid:安卓虚拟机上的名字 emulator模拟器模拟手机硬件

5什么是安卓 ? 基于linux 的手机os

6安卓开发环境 : JDK eclipseAndroid-sdk ADT

7 adt是一个eclipse插件

Adt是调用安卓sdk的工具

8 adb是安卓sdk中的一个工具

9 adb全称android debug bright

10手机术语:root(系统权限) ram(手机运行内存)rom(手机储存空间)

11什么是gps(是一种全球定位系统)

12 agps是什么?(辅助全球卫星定位系统)

13 容器:1)view 2)view Group

14 指定组件:通过代码定义;xml定义

15 apk包括代码进程;androidmanifest。Xml;资源文件。apk不包括用户资料

16进程优化集(前台进程 -》可见服务-)服务进程—》后台进程—》空进程)(由高到低)

17常用五种布局方式,分别是:FrameLayout(框架布局),LinearLayout (线性布局),AbsoluteLayout(绝对布局),RelativeLayout(相对布局),TableLayout(表格布局)。

18 adt插件(同第七题)

19 sdk :软件开发工具包

20 intent:不同组件之间传递消息

21 android >androidmanifest.xml 不能修改

22使用button findviewbyId方法获取组件

23 rom:相当于pc中的c ram :相当于pc中的内存

24 Sqlite是嵌入式关系数据库

25 菜单3种:上下文菜单 选项菜单 子菜单

26 填空题(模拟器)(有可能写英语单词)

27 简述Android系统架构从高到低的几个层次。

答:android从高层到低层分为以下几个层次。

应用程序层(Application)

应用程序框架层(Application Framework)

各种库(Libraries)和运行环境(RunTime)

linux核心层(OS)

28安卓的平台搭建必须的软件是 JDK eclipse-SDK Android-sdk ADT

29应用程序的基本组件有哪些?

答:

(1) Activity。

(2) Service。

(3) Broadcast Receiver。

(4) Content Provider。

(5)Intent。

30 文件读写

1. FileOutputStream stream = openFileOutput(fileName, MODE_PRIVATE);

2. byte[] bytes = message.getBytes();

3. stream.write(bytes);

4. stream.close();

5. FileInputStream stream = openFileInput(fileName);

6. int len = stream.available();

7. byte[] bytes = new byte[len];

8. stream.read(bytes);

9. result = EncodingUtils.getString(bytes, ENCODING);

10. stream.close();

01.public class UIDataActivity extends Activity {

02.

03. public static final String ENCODING = "UTF-8";

04. String fileName="test.txt";

05. String message = "Android数据存储I/O例子 ";

06. TextView textView;

07.

08.

09. /** Called when the activity is first created. */

10. @Override

11. public void onCreate(Bundle savedInstanceState) {

12. super.onCreate(savedInstanceState);

13. setContentView(R.layout.main);

14.

15. /*

16. * 本示例是应用程序在私有数据文件夹下创建一个文件并读取其中的数据显示在TextView

17. */

18.

19. writeFileData(fileName,message);

20.

21. String result = readFileData(fileName);

22.

23. textView = (TextView)findViewById(R.id.tv);

24. textView.setText(result);

25. }

26.

27. public void writeFileData(String fileName,String message){

28. //使用FileOutputStream对象如果文件不存在或者不可以写入时.会抛出FileNotFoundException异常

29. try {

30. FileOutputStream stream = openFileOutput(fileName, MODE_PRIVATE);

31. byte[] bytes = message.getBytes();

32. stream.write(bytes);

33. stream.close();

34. } catch (FileNotFoundException e) {

35. // TODO Auto-generated catch block

36. e.printStackTrace();

37. } catch (IOException e) {

38. // TODO Auto-generated catch block

39. e.printStackTrace();

40. }

41. }

42.

43. public String readFileData(String fileName){

44. String result ="";

45. try {

46. FileInputStream stream = openFileInput(fileName);

47. int len = stream.available();

48. byte[] bytes = new byte[len];

49. stream.read(bytes);

50. result = EncodingUtils.getString(bytes, ENCODING);

51. stream.close();

52. } catch (FileNotFoundException e) {

53. // TODO Auto-generated catch block

54. e.printStackTrace();

55. } catch (IOException e) {

56. // TODO Auto-generated catch block

57. e.printStackTrace();

58. }

59. return result;

60. }

61.}

获取LocationManager对象 getSystemService(Context.LOCATON_SERVICE); 获取当前位置 getLastKnownLocation(String provider) 监听位置变化 requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) Manifest文件中声明权限

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP