-
In Eclipse select 'File' > 'New' > 'Project...' > 'Android' > 'Android Application Project'
-
Name Application Name 'Rita Example' and select 'API 15' as the Minimum Required SDK
-
Keep pressing 'Next' and select 'Blank Activity' when prompted and finish
-
Edit 'activity_main.xml' and select 'activity_main.xml' at the bottom (next to 'Graphical Layout' tab)
-
Replace it with the following code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.ritaexample.MainActivity" > <TextView android:text="@string/hello_world" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/textView" android:layout_centerVertical="true" android:layout_centerHorizontal="true" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView" android:layout_marginLeft="94dp" android:layout_marginTop="86dp" android:layout_toRightOf="@+id/textView" > </RelativeLayout> </RelativeLayout>
-
Download and drag RiTa.jar into the libs folder of RitaExample project
-
When prompted select 'Copy File' then right click on it select 'Build Path' > 'Add to Build Path'
-
To test a simple example, replace the code of 'MainActivity.java' with the following:
package com.example.ritaexample; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import rita.*; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String [] a = RiTa.tokenize("The cat ate the stinky cheese."); TextView t = (TextView) findViewById(R.id.textView); t.setText( java.util.Arrays.toString(a) ); } }
-
Right click on RitaExample and select 'Run As' > 'Android Application'
To install:
-
Start a new Android Studio project with application name 'Rita Example' and dompany domain 'example.com', select 'Blank Activity' and then finish
-
In the project window 'manifests', 'java' and 'res' packges can be seen under 'app'
-
Right click on 'java' and create a new package called 'libs', dragging the rita.jar inside
-
When prompted check 'Search for references' and select 'Unlock files'
-
Right-click on the jar file > 'Add As Library...'
-
Add 'import rita.*;' to the top of your .java file
-
To test a simple example, replace the code of 'MainActivity.java' with the following:
package com.example.ritaexample; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import rita.*; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String [] a = RiTa.tokenize("The cat ate the stinky cheese."); TextView t = (TextView) findViewById(R.id.textView); t.setText( java.util.Arrays.toString(a) ); } }
Please! We are looking for more coders to help out... Just press Fork at the top of this github page and get started, or follow the 'Development Setup' instructions at the bottom of this page...