Import contact vfc

69 views
Skip to first unread message

nir hasan

unread,
Jun 4, 2024, 6:49:08 PMJun 4
to Automate for Android
Hey !

So here is my issue .


I am doing some kind of automation , via adb .

I would like to import vcf file via adb , I've tried lots of stuff with any success unfortunately 
So i thought about automate .
To have a flow and run it via adb .

However when looking into the flows and in the community flow i was not able to find anything on the matter .

Any help would be appreciated .

(The only thing i found was really outdated like 10y ago with old google contacts which doesn't have this intent anymore)

I want to fill automate that via adb 

Thanks!!

nir hasan

unread,
Jun 5, 2024, 4:07:52 AMJun 5
to automa...@googlegroups.com

i even tried with a different app to do it automatically , however the app does not seems to find the file , AND it requires select where i want to store the data , and to press ok

adb shell am start -t "text/x-vcard" -d "file:///sdcard/contacts_20240604190946.vcf" -a android.intent.action.VIEW com.simplemobiletools.contacts.pro



--
You received this message because you are subscribed to a topic in the Google Groups "Automate for Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automate-user/IZVyrR3ikFk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/de09e696-9f1e-4517-b305-73903af3dc40n%40googlegroups.com.

Henrik "The Developer" Lindqvist

unread,
Jun 5, 2024, 5:42:08 AMJun 5
to Automate for Android
It seems Android lacks any built-in API import vcard files, there may only be an graphical UI to do so, try launching it with a flow like:
  1. Flow beginning
  2. File pick: Content type=File, Picked path=file
  3. App start: Action=View, Data URI=fileUri(file), MIME type=text/x-vcard, Flags=Grant URI read permission
If you must do it without user intervention then try using the Interact block block to simulate clicks on any OK/import button.
To do it without an UI then try parsing the vcard format then use the Contact add or Content insert blocks.

nir hasan

unread,
Jun 6, 2024, 3:55:48 AMJun 6
to automa...@googlegroups.com
parsing the vcf is impossible , there is like hundreds contacts , doing it by hand  neva ! this is why i want to automate things :D  
i mean it must be quick aswell so parsing and adding one by one will take time , to long .


i did thought about doing it as interact block , i tried im not gona lie , but it stoped after one click , i thought it would've do the whole thing , 
i need to record each press in each block 


i havent understand what you meant with 

  1. Flow beginning
  2. File pick: Content type=File, Picked path=file
  3. App start: Action=View, Data URI=fileUri(file), MIME type=text/x-vcard, Flags=Grant URI read permission

--
You received this message because you are subscribed to a topic in the Google Groups "Automate for Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automate-user/IZVyrR3ikFk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automate-use...@googlegroups.com.

nir hasan

unread,
Jun 6, 2024, 3:55:56 AMJun 6
to automa...@googlegroups.com
i set file pick?
types > File
i tried with initial path > location of the file  and without .
picked path > file

when running the flow it is stuck on File Pick ,  so i helped it abit by ticking >
show windows directly if possible > V 

so i can pick the file manually .

i am selecting the file , manually 
it opens the app saying invalid file format  (when it is 100% working if i do it within the app) 

Henrik "The Developer" Lindqvist

unread,
Jun 6, 2024, 6:22:12 AMJun 6
to Automate for Android
Odd, try changing #4:
  • App start: Action=View, Data URI=fileUri(file,"f"), MIME type=text/x-vcard
If that doesn't work then:
  • App start: Action=View, Data URI=fileUri(file,"f"), MIME type=text/vcard

nir hasan

unread,
Jun 6, 2024, 7:22:59 PMJun 6
to Automate for Android
Neither worked , i am showing you just incase i fucked up something 
Screenshot_20240606-231625.png
Screenshot_20240606-231553.png
Screenshot_20240606-231541.png

Henrik "The Developer" Lindqvist

unread,
Jun 7, 2024, 5:16:58 AMJun 7
to Automate for Android
In the App start block you need to click the fx icon before writing in the fileUri(..), otherwise it will be interpreted as a text literal.

nir hasan

unread,
Jun 7, 2024, 10:37:45 AMJun 7
to automa...@googlegroups.com

Invalid format aswell.

But that wouldn't work to because its manual and i want to be fully automated.

Is that possible to record a full chain of clicks within one block ?


Henrik "The Developer" Lindqvist

unread,
Jun 7, 2024, 10:46:35 AMJun 7
to Automate for Android
It was just an example, if you know the path to the file, then just write it in, e.g. fileUri("Documents/test.vcf")
The "Record interaction" button can record multiple clicks, but in the flow each will need a separate Interact block.
Reply all
Reply to author
Forward
0 new messages