Make activities and broadcast receivers not add AndroidManifest.xml entries by default #206

donv opened this Issue Jul 5, 2012 · 0 comments

1 participant

Ruboto member

Only the initial activity needs a manifest entry. Other activities and broadcast receivers can be started programmatically.

All services need manifest entries.

Activites and BroadcastReceivers called from other apps need manifest entries. These are added using the --manifestswitch in lib/ruboto/commands/base.rb`.

              option("manifest") {
                description "add an entry in the AndroidManifest.xml"
                cast :boolean
                add_manifest = params['manifest'].value
                if klass == 'Service' || add_manifest

The test framework should be modified to allow testing of activities without a corresponding manifest entry or Java class:

ruboto_activity 'SampleActivity'

instead of

activity Java::THE_PACKAGE.SampleActivity

This is implemented by a new method in org.ruboto.test.InstrumentationTestRunner

    public void ruboto_activity(String rubyClassName) {
        this.activityClass = RubotoActivity;
        this.rubyClassName = rubyClassName;

This will trigger a call to setActivityIntent (Intent i); in org.ruboto.test.ActivityTest

Ruboto tests must use the new way, either generate test activities using the new switch in app_test_methods.rb:

system "#{RUBOTO_CMD} gen class Activity --name #{activity_name}Activity --manifest"
system "#{RUBOTO_CMD} gen class Activity --name #{activity_name} --manifest"

or test new activities with ruboto_activity instead of activity for specifying the activity under test.
@donv donv modified the milestone: 1.1.1, 1.1 May 18, 2014
@donv donv modified the milestone: 1.1.2, 1.1.1 Jul 1, 2014
@donv donv modified the milestone: 1.1.3, 1.1.2 Jul 9, 2014
@donv donv modified the milestone: 1.2, 1.1.3 Oct 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment