A platform for developing apps using JRuby on Android.
A platform for developing apps using JRuby on Android.
Ruboto 2 is a redesign based on an Android Studio workflow. This means that the JRuby and Ruboto components will integrate into the standard gradle tooling used by regular Android Studio projects.
Download and install Android studio.
Choose "Create New Project" in the startup screen.
Add a jcenter to the dependencyResolutionManagement/repositories section of your settings.gradle file:
dependencyResolutionManagement {
...
repositories {
...
jcenter()
}
}Add the these dependencies to your app/build.gradle file:
dependencies {
...
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.linkedin.dexmaker:dexmaker:2.19.1'
implementation 'me.qmx.jitescript:jitescript:0.4.1'
implementation 'com.jakewharton.android.repackaged:dalvik-dx:7.1.0_r7'
}Add gems.rb file:
source 'https://rubygems.org/'
gem 'ruboto', '~>2.0.dev', git: 'https://github.com/ruboto/ruboto.git'Ensure you are using JRuby on the command line
Create a .ruby-version file:
jrubyInitialize Ruboto:
jruby -S bundle
jruby -S bundle exec ruboto initThis will copy the core files to your project.
Add app/gems.rb
source 'https://rubygems.org/'
gem 'activerecord', '~>7.0'
gem 'activerecord-jdbc-adapter', '~>70.1'
gem 'sqldroid', '~>1.0'Add app/update_jruby_jar.sh:
…Make app/update_jruby_jar.sh executable:
chmod u+x app/update_jruby_jar.shGenerate jruby.jar:
app/update_jruby_jar.shGenerate the startup activity:
bundle exec ruboto gen class Activity --name StartupActivityAdd the startup activity intent filter to the new activity tag in app/src/main/AndroidManifest.xml:
<activity android:name='StartupActivity' android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>Declare the Ruboto components and SplashActivity in app/src/main/AndroidManifest.xml
<activity android:name='org.ruboto.RubotoActivity' />
<activity android:name='org.ruboto.RubotoDialog' android:theme='@android:style/Theme.Dialog' />
<service
android:name='org.ruboto.RubotoService'
android:exported='false' />
<activity
android:name='org.ruboto.SplashActivity'
android:configChanges='orientation|screenSize'
android:exported='false'
android:noHistory='true' />Rember to sync the gradle config after the changes.
Start your app!
Update your app/gems.rb (or app/Gemfile) and run
bundle exec rake bundleHOWTO missing. Pull requests welcome!
Looking for Ruboto 1.x? Switch to the ruboto_1.x branch.
No open issues yet, or sync has not completed.