Basic4Android安装使用说明_第1页
Basic4Android安装使用说明_第2页
Basic4Android安装使用说明_第3页
Basic4Android安装使用说明_第4页
Basic4Android安装使用说明_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Basic4Android 安装使用说明,及学习日记一、 安装配置1、安装.net2,安装jdk2、安装 Android SDK, 安装后运行,还会提示要在线下载对应的系统,如选择Android 4.03如何解决安卓SDK无法下载Package的问题 -因为网络IP被封了。 修改Hosts文件C:WindowsSystem32driversetchosts46 46 、打开安卓SDK管理器“Android SDK Manager”,点击菜单栏中的“Tools/Options”打开设置窗体。勾选Force开头的复选框按钮,然后点击“Close”按钮关闭并保存设置。3、安装.net2以上(否则basic4一启动报错000000135) 4、运行Basic4Android 1.9绿色版 Basic4android.exe二、HelloWorld 、问题:运行时编译,可能提示 文件不对,将提示的文件夹复制到 C:Document SettingsAdministrod目录下; 、运行时,应该在 tools菜单下,启动MVD?,创建手机模拟器; 不过,编译会很慢。 建议直接接上手机,系统设置/开发人员选项/设置为USB调试模式。编译运行速度会加快。 、手工创建对象Dim wv As WebView 定义wv.Initialize(wv) 初始化,关键是指定一个事件名称 后面可以sub wv_click之类的事件Activity.AddView(wv,0,0,100%x,100%y) 加入VIEW,位置可以使用了wv.LoadUrl(/)/ Dim Timer1 As Timer Timer1.Initialize(Timer1,1000) Timer1.Enabled=TrueSub Timer1_Tick /(即interval 事件)Label1.Text=Svr.c End Sub/退出确认Sub Activity_KeyPress (KeyCode As Int) As Boolean Dim Answ As Int If KeyCode = KeyCodes.KEYCODE_BACK Then Answ = Msgbox2(确定要退出吗?, 注意, Yes, , No, Null) If Answ = DialogResponse.NEGATIVE Then Return True End If End If Return False End Sub / For i = 0 To Cursor1.RowCount -1 Cursor1.Position = i Dim img1 As ImageView img1.Initialize(ImgView) img1.Bitmap = LoadBitmap(File.DirAssets, audit_template_new.png) ScrollView1.Panel.AddView(img1, 40dip, img_height, 728dip, 115dip) QuestionRef Dim lbl_questionref As Label lbl_questionref.Initialize(Label) lbl_questionref.Text = Cursor1.GetString(QuestionNr) lbl_questionref.TextColor = Colors.Black ScrollView1.Panel.AddView(lbl_questionref, 50dip, img_height+10dip, 350dip, 40dip) Question Content Dim lbl_question As Label lbl_question.Initialize(Label) lbl_question.Text = Cursor1.GetString(Question) lbl_question.TextColor = Colors.DarkGray ScrollView1.Panel.AddView(lbl_question, 50dip, img_height+40dip, 380dip, 70dip) Image Blank Dim img_blank_yes As ImageView img_blank_yes.Initialize(YES) img_blank_yes.Bitmap = LoadBitmap(File.DirAssets, yes_blank.png) img_blank_yes.BringToFront img_blank_yes.Tag = i ScrollView1.Panel.AddView(img_blank_yes, 475dip, img_height+31dip, 47dip, 50dip) Add 115 to add to the TOP value img_height = img_height + 115dip Next/ ScrollView1.Panel.Height = 800dip btn1.Initialize() btn1.Text = True btn2.Initialize() btn2.Text = False label1.Initialize() label1.Text = True label1.Color = Colors.Cyan label2.Initialize() label2.Text = label2.Color = Colors.Yellow spin1.Initialize() ScrollView1.Panel.AddView(spin1, 10dip, 5dip, 200dip, 50dip) ScrollView1.Panel.AddView(btn1, 10dip, 55dip, 200dip, 50dip) ScrollView1.Panel.AddView(btn2, 10dip, 105dip, 200dip, 50dip) ScrollView1.Panel.AddView(label1, 10dip,155dip, 200dip, 50dip) ScrollView1.Panel.AddView(label2, 10dip,205dip, 200dip, 50dip) spin1.AddAll(Array As String(a, b, c, d) btn1.Visible = False btn2.Visible = False /1、另外,使用B4A Bridge,调试很方便 、手机上下载安装 B4A Bridge,并启动 、Basic4Android 1.9,菜单Desiger,打开界面可视化设计器,类似于Form,可将文件保存为Form1,Form2等。 Timer 是不可视组件设计器中创建的不需要屏幕方向:Phone library.It can also be done by code with SetScreenOrientation from the Phone library: Landscape Phone1.SetScreenOrientation(0) Portrait Phone1.SetScreenOrientation(1) Both Phone1.SetScreenOrientation(-1) 启动另一程序:Phone library.The PackageManager is an object in the Phone library. The exact package name is needed ! Dim pm As PackageManager Dim in As Intent in.Initialize(, ) in = pm.GetApplicationIntent If in.IsInitialized Then StartActivity(in) End If判断屏幕方向:The code below detects the screen orientaion, comparing if the activity width is greater than the activity height then the orientation is landscape otherwise its portrait. Sub Globals Dim Orientation As String End Sub Sub Activity_Create(FirstTime As Boolean) If Activity.Width Activity.Height Then Orientation = Landscape Else Orientation = Portait End If End Sub

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论