Permalink
Browse files

Initial Commit.

  • Loading branch information...
0 parents commit f94a9b50d26d69d576021cb4a85c1c2a6e2c8502 @technomancy committed Feb 4, 2010
@@ -0,0 +1,3 @@
+local.properties
+bin
+gen
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="garrett.p.serviss"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <application android:label="@string/app_name" android:icon="@drawable/icon">
+ <activity android:name="Garrett"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
@@ -0,0 +1,18 @@
+# Garrett
+
+Garrett is a playground for Duby exploration on Android.
+
+## Compilation
+
+Copy local.properties.example to local.properties and edit it to point
+to your SDK. If you're not targeting Android 2.1, you might need to
+edit default.properties too.
+
+You'll need [Duby](http://github.com/headius/duby) checked out,
+compiled, and on your path. At the time of this writing, the
+"super_fixes" branch must be used.
+
+Then you should be set to do "ant debug", and an .apk file should be
+generated in the bin/ directory. You should then be able to install it
+using "adb install" or by putting it on a public web server and
+navigating to that URL from your device.
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="Garrett" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked in in Version
+ Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The build.properties file can be created by you and is never touched
+ by the 'android' tool. This is the place to change some of the default property values
+ used by the Ant rules.
+ Here are some properties you may want to change/update:
+
+ application.package
+ the name of your application package as defined in the manifest. Used by the
+ 'uninstall' rule.
+ source.dir
+ the name of the source directory. Default is 'src'.
+ out.dir
+ the name of the output directory. Default is 'bin'.
+
+ Properties related to the SDK location or the project target should be updated
+ using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems.
+
+ -->
+ <property file="build.properties" />
+
+ <!-- The default.properties file is created and updated by the 'android' tool, as well
+ as ADT.
+ This file is an integral part of the build system for your application and
+ should be checked in in Version Control Systems. -->
+ <property file="default.properties" />
+
+ <!-- Custom Android task to deal with the project target, and import the proper rules.
+ This requires ant 1.6.0 or above. -->
+ <path id="android.antlibs">
+ <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+ <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+ </path>
+
+ <taskdef name="setup"
+ classname="com.android.ant.SetupTask"
+ classpathref="android.antlibs" />
+
+ <!-- Execute the Android Setup task that will setup some properties specific to the target,
+ and import the build rules files.
+
+ The rules file is imported from
+ <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+ To customize some build steps for your project:
+ - copy the content of the main node <project> from android_rules.xml
+ - paste it in this build.xml below the <setup /> task.
+ - disable the import by changing the setup task below to <setup import="false" />
+
+ This will ensure that the properties are setup correctly but that your customized
+ build steps are used.
+ -->
+ <setup />
+
+ <target name="compile" depends="-resource-src, -aidl"
+ description="Compiles project's .duby files into .class files">
+ <exec executable="dubyc" dir="src">
+ <env key="CLASSPATH" file="${sdk.dir}/platforms/${target-version}/android.jar:gen/" />
+ <arg value="-d" />
+ <arg value="../bin/classes/" />
+ <arg value="." />
+ </exec>
+ </target>
+
+</project>
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
+target-version=android-2.1
BIN icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,10 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must *NOT* be checked in Version Control Systems,
+# as it contains information specific to your local configuration.
+
+# location of the SDK. This is only used by Ant
+# For customization when using a Version Control System, please read the
+# header note.
+sdk.dir=/home/phil/src/android/sdk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Hello World, Garrett"
+ />
+</LinearLayout>
+
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Garrett</string>
+</resources>
@@ -0,0 +1,47 @@
+import "android.app.Activity"
+import "android.content.Context"
+import "android.os.Bundle"
+
+import "android.view.View"
+import "android.graphics.Canvas"
+import "android.graphics.Paint"
+
+class GarrettView < View
+ def initialize(a:Context)
+ super(a)
+ @paint = Paint.new
+ @paint.setARGB(250, 50, 50, 200)
+ @frame = 0
+ @radius = 50
+ @x = @radius
+ @y = @radius
+ @xv = 1
+ @yv = 1
+ end
+
+ def bounce
+ if @x > (getWidth - @radius) or @x < @radius
+ @xv = -@xv
+ end
+ if @y > (getHeight - @radius) or @y < @radius
+ @yv = -@yv
+ end
+ end
+
+ def onDraw(canvas:Canvas)
+ @frame = @frame + 1
+ @x = @x + @xv
+ @y = @y + @yv
+ bounce
+ canvas.drawCircle(@x, @y, @radius, @paint)
+ invalidate
+ end
+end
+
+class Garrett < Activity
+ def onCreate(savedInstanceState:Bundle)
+ super(savedInstanceState)
+ v = GarrettView.new(self)
+ setContentView(v)
+ end
+end

0 comments on commit f94a9b5

Please sign in to comment.