Weitere ähnliche Inhalte
Kürzlich hochgeladen (20)
Ruboto
- 2. The ruboto-core build process
Ruboto java
files
Compiled Jruby
class files JARS
Compiled Ruby
.dex scripts
APK
- 4. ruboto-core
• Means of packaging Ruby scripts for
Android as an .apk
• http://github.com/ruboto
• gem install ruboto-core
- 5. Generating app
$ ruboto gen app --package com.my.app --path myapp --name
MyApp
--target android-8 --activity MyActivity
• --package: provides the unique Android package
name.
• --path: which folder
• --name: name of the app
• --target: which android version to compile against.
• --activity: generates android activity.
- 7. Java
p.v Activity.onCreate(Bundle bundle) import android.widget.Toast;
p.v Activity.onPause() Toast toast = Toast.makeText(
p.v Activity.onClick(View view) getApplicationContext(), “Hello!",
Toast.LENGTH_SHORT );
toast.show();
Ruby
on_create (bundle) import android.widget.Toast
on_pause Toast toast = Toast.makeText(
@handle_click = proc do |view| $activity, “Hello!",
Toast::LENGTH_LONG ).show