Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Do you have a detailed tutorial? #57

Open
everydaysayhello opened this issue Jan 11, 2021 · 5 comments
Open

Do you have a detailed tutorial? #57

everydaysayhello opened this issue Jan 11, 2021 · 5 comments

Comments

@everydaysayhello
Copy link

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

@freakboy3742
Copy link
Member

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.

@everydaysayhello
Copy link
Author

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
Copy link
Author

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!

@freakboy3742
Copy link
Member

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.

@everydaysayhello
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants