rubicon-java icon indicating copy to clipboard operation
rubicon-java copied to clipboard

Do you have a detailed tutorial?

Open everydaysayhello opened this issue 5 years ago • 5 comments

Do you have a detailed tutorial? I didn't find a detailed tutorial on the official website.

everydaysayhello avatar Jan 11 '21 07:01 everydaysayhello

Unfortunately not. This is an area we'd like to improve;

At present, the best sources of learning material I can point you at are:

  1. the test suite for Rubicon-Java (in this repo) - by it's nature, a test suite contains lots of examples of usage
  2. The codebase for the Android backend for Toga. This is the primary user of Rubicon at present; the Andoid Java libraries are wrapped in the libs module, and then used in the various widgets and app classes.

I agree this isn't ideal; writing a more comprehensive tutorial (like the one that we have for Rubicon-ObjC) is on our TODO list.

freakboy3742 avatar Jan 11 '21 07:01 freakboy3742

Unfortunately not. This is an area we'd like to improve;

At present, the best sources of learning material I can point you at are:

  1. the test suite for Rubicon-Java (in this repo) - by it's nature, a test suite contains lots of examples of usage
  2. The codebase for the Android backend for Toga. This is the primary user of Rubicon at present; the Andoid Java libraries are wrapped in the libs module, and then used in the various widgets and app classes.

I agree this isn't ideal; writing a more comprehensive tutorial (like the one that we have for Rubicon-ObjC) is on our TODO list.

Can I ask you a question by the way? How can I access 'context' or 'activity' in Python code? When accessing with javaclass ('android / content / context '), an error will be reported.

everydaysayhello avatar Jan 12 '21 02:01 everydaysayhello

Unfortunately not. This is an area we'd like to improve;

At present, the best sources of learning material I can point you at are:

  1. the test suite for Rubicon-Java (in this repo) - by it's nature, a test suite contains lots of examples of usage
  2. The codebase for the Android backend for Toga. This is the primary user of Rubicon at present; the Andoid Java libraries are wrapped in the libs module, and then used in the various widgets and app classes.

I agree this isn't ideal; writing a more comprehensive tutorial (like the one that we have for Rubicon-ObjC) is on our TODO list.

Because I want to use Python to access some functions of Android, such as locating, taking pictures, and getting the address book. Do you have any examples? Thanks for your help!

everydaysayhello avatar Jan 12 '21 02:01 everydaysayhello

On toga-android, the App implementation has a native attribute that is the Activity. This is cached on every widget as _native_activity. Activity is a subclass of Context.

The only examples of usage I can point you at is the usage in the Toga Android backend.

freakboy3742 avatar Jan 12 '21 02:01 freakboy3742

On toga-android, the App implementation has a native attribute that is the Activity. This is cached on every widget as _native_activity. Activity is a subclass of Context.

The only examples of usage I can point you at is the usage in the Toga Android backend.

I have another problem. Can you help me?Thank you very much!How can I transfer Java language 'null' to Python when I call java function? I tried to replace it with None, but I would report a NoneType error. And there is no array in Python, so I have no way to pass array parameters.

everydaysayhello avatar Jan 13 '21 00:01 everydaysayhello