Add Contact to Android Phone Book Via Tasker By running JAVA code at RuntTime

279 views
Skip to first unread message

beshoo

unread,
Jun 1, 2016, 9:03:39 PM6/1/16
to tas...@googlegroups.com

first of all , sorry for my English.

I am Tasker User.

Problem: I want to insert / Create, a new Contact in Android Phone Book.

There is No Plugin has been created by any one for such purbes.

The method has to be run in background / so there is no autoInputs via simulation user input on the screen.

Recently Tasker support Java at runtime.

Tasker allows the advanced user to directly call Java functions and work with Java objects themselves.

It does not allow you to 'write Java code'... but the combination of Tasker's logic and flow control with direct access to the Android API is sufficient for most automation purposes.

Source : http://tasker.dinglisch.net/userguide/en/java.html

So at this point , I am kindly asking from Dev to help me to line up small source code in order to test it in Tasker app to insert a new Contact via java.

I trid this scenario but it dos not work.

Tasker java Sample


Juergen Gruen

unread,
Jun 2, 2016, 1:32:00 AM6/2/16
to Tasker
Hi,
first you have to replace the constants with their actual value, for example: Data.Raw_Contact_Id = raw_contact_id

https://developer.android.com/reference/android/provider/ContactsContract.Data.html


I'm not sure if Tasker has the permission to write contacts.

Juergen.

Juergen Gruen

unread,
Jun 2, 2016, 1:46:47 AM6/2/16
to Tasker
Just checked with AppXplore, the permission is granted... So it could work...

John Doe

unread,
Jun 2, 2016, 2:28:29 AM6/2/16
to Tasker
You can use ContactsTask in order to do it, much easier.

Juergen Gruen

unread,
Jun 2, 2016, 3:28:06 AM6/2/16
to Tasker
Ah, adding contacts is a new option in the plugin...
Reply all
Reply to author
Forward
0 new messages