[Wish]Make to know the method of google's java APIs easier.

Theera

Expert
Licensed User
Longtime User
I think about agrahm's reflection lib is more useful,but using with the method of google's java APIs is difficult to find them.
 

Theera

Expert
Licensed User
Longtime User
How to get all of method from Google's developler
 

Theera

Expert
Licensed User
Longtime User
Two Strategies are different about using Reflection.

Hi all,

I 've tried to point the difference between the expert man who known both of Java and B4A and the un-expert man who known only B4A in using the reflection Lib. OK! Now! I've 2 strategies in the same program. I hope that you understand me ,why do I think the reflection lib is diffcult for the un-expert man.
(@Klaus ,you are the best man who could explain easy English langauge to me,and always understand that what am I thinking)
@NFOboy ,Thank for the sample. I hope to see the next vesion which hide coding about java in B4A programming.

Best Regards

Theera
 
Last edited:

agraham

Expert
Licensed User
Longtime User
There is no alternative to knowing about the Android Java APIs, and some Java, if you want to use Reflection. Reflection is intended for expert users to use to get down to the Java API level. No automatic tool to produce Basic4android code is possible. You need to either learn enough to use it for yourself or ask someone who does know do it for you.
 

IanMc

Well-Known Member
Licensed User
Longtime User
I agree with Theera and I like the ideas of:

expert man

un-expert man

with apologies to all female developers

B4a is a higher level language so it annoys the heck out of me when I have to do a lot of work on a single thing to figure out how to incorporate it into my project.

Erel is brilliant, we all know that but is he restricted?

If someone makes a library that he wants to sell then is Erel morally inhibited in incorporating that library's functions into future versions of B4a?

If so then we all suffer

Basic 4 android ... not Complex 4 android
 
Last edited:

pierpa

Member
Licensed User
Longtime User
If i know how to manage the phonebook in java, will i be able to do it in B4A? Through reflection and such, I mean.
 

pierpa

Member
Licensed User
Longtime User
I am talking about five-ten lines of code. I don't want to install eclipse for ten lines of java...
 

pierpa

Member
Licensed User
Longtime User
the code from stackoverflow is the following (somehow edited):

B4X:
ContentResolver cr = this.getContentResolver();

ContentValues values = new ContentValues();

values.clear();

String noteWhere =
   ContactsContract.Data.CONTACT_ID +
   " = ? AND " +
   ContactsContract.Data.MIMETYPE +
   " = ?"; 

String[] noteWhereParams = new String[]{id, 
   ContactsContract.CommonDataKinds.Note.CONTENT_ITEM_TYPE}; 
   // Constant Value: "vnd.android.cursor.item/note"

values.put(CommonDataKinds.Note.NOTE, "NEW NOTE HERE!!!!");

cr.update(ContactsContract.Data.CONTENT_URI, values, noteWhere, noteWhereParams);

Cursor noteCur = cr.query(ContactsContract.Data.CONTENT_URI, null, noteWhere, noteWhereParams, null);

if (noteCur.moveToFirst())
 { 
  String note = noteCur.getString(noteCur.getColumnIndex(ContactsContract.CommonDataKinds.Note.NOTE));
 } 

noteCur.close();

i really don't know if this is good for reflection.

actually i like to work on b4a because i don't like the idea of writing "native" 30 lines of code for an "hello world" button/popup

i want to focus on the functions of my app, but also i tried to launch a sponsorship for a complete contacts library
 
Top