^_^

2009年7月30日星期四

谷歌向Android应用程序开发者推出Simple语言

谷歌周一发布了一款名为Simple编程语言,旨在激励软件开发者为Android平台编写应用程序。Google公司的软件工程师Herbert Czymontek在一个博客帖子上表示:
Simple是一款BASIC风格的编程语言,用来开发Android程序。Simple项目的初衷是为移动领域以及Android平台引入一款简单易学的编程语言。
Simple可以提供对Android的手机硬件的直接访问,如加速器、定位仪、手机及电话薄。

Let's take a look at the source code for the famous Etch-A-Sketch application:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Dim x As Integer
Dim y As Integer

Event OrientationSensor1.OrientationChanged(yaw As Single, _
pitch As Single, roll As Single)

If roll < -20 Then
x = Math.Min(Canvas1.Width, x + 1)
ElseIf roll > 20 Then
x = Math.Max(0, x - 1)
End If
If pitch < -20 Then
y = Math.Min(Canvas1.Height, y + 1)
ElseIf pitch > 20 Then
y = Math.Max(0, y - 1)
End If
Canvas1.DrawPoint(x, y)
End Event

Event AccelerometerSensor1.Shaking()
Canvas1.Clear()
End Event

$Properties
$Source $Form
$Define EtchSketch $As Form
Layout = 3
BackgroundColor = &HFFFFFFFF
Title = "EtchSketch: Tilt to draw - Shake to clear"
$Define Canvas1 $As Canvas
$End $Define
$Define OrientationSensor1 $As OrientationSensor
$End $Define
$Define AccelerometerSensor1 $As AccelerometerSensor
$End $Define
$End $Define
$End $Properties
本站文章除注明外,均为本站原创
转载请注明文章转载自: 大笨熊乐园 [ https://blog.foolbear.com/ ]
文章标题: 谷歌向Android应用程序开发者推出Simple语言
文章地址: https://blog.foolbear.com/2009/07/androidsimple.html

没有评论 :

发表评论

Related Posts with Thumbnails