Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Contacts plugin
Started by Scott Harrison Nov 24 2016 08:41 AM

46 replies to this topic
ios android
[TOPIC CONTROLS]
Page 2 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

I will try to add it but it is possible to do adb on windows.

https://forums.coronalabs.com/topic/35018-easiest-detailed-way-to-debug-corona-app-on-android-device/

[TOPIC: post.html]
#27

rodrigopalmeira

[GLOBAL: userInfoPane.html]
rodrigopalmeira
  • Enthusiast

  • 50 posts
  • Corona SDK

Scott. Here's the Log from Android Studio LogCat/Monitor.

 

https://filetea.me/t1s8Je5xRB4SOOC8ZxhNFKfMg



[TOPIC: post.html]
#28

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

that link does not work, just paste it in the code box on forums with <>



[TOPIC: post.html]
#29

rodrigopalmeira

[GLOBAL: userInfoPane.html]
rodrigopalmeira
  • Enthusiast

  • 50 posts
  • Corona SDK

Ops! Sorry

And now?

 

https://www.dropbox.com/s/8zw68g01mogdzj1/ErroLog.txt?dl=0



[TOPIC: post.html]
#30

rodrigopalmeira

[GLOBAL: userInfoPane.html]
rodrigopalmeira
  • Enthusiast

  • 50 posts
  • Corona SDK

This TXT is the Full Log. But this one is just the moment when it crashes.

AllocSpace objects, 0(0B) LOS objects, 33% free, 29MB/44MB, paused 1.709ms total 135.693ms
12-05 16:47:47.691: I/Corona(8194): ERROR: Runtime error
12-05 16:47:47.691: I/Corona(8194): /Users/Palmeira/Downloads/contacts-demo-master/main.lua:18: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.contains(java.lang.CharSequence)' on a null object reference
12-05 16:47:47.691: I/Corona(8194): Java Stack Trace:
12-05 16:47:47.691: I/Corona(8194): 	plugin.contacts.LuaLoader$get.invoke(LuaLoader.java:451)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.JavaToNativeShim.nativeTouchEvent(Native Method)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.JavaToNativeShim.touchEvent(JavaToNativeShim.java:416)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.input.RaiseTouchEventTask.executeUsing(RaiseTouchEventTask.java:39)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.Controller.updateRuntimeState(Controller.java:308)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623)
12-05 16:47:47.691: I/Corona(8194): 	com.ansca.corona.graphics.opengl.GLSurfaceVi
12-05 16:47:47.730: V/WindowManager(914): not Base app: Adding window Window{251f3fa2 u0 br.com.rodrigopalmeira.contatos/com.ansca.corona.CoronaActivity} at 5 of 11
12-05 16:47:48.076: I/MotoNetwCtrlr.MotoWifiHndlr(1138): handleMessage: Entered msg.what=1


[TOPIC: post.html]
#31

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

Thanks I think I know the issue. Working on fix

[TOPIC: post.html]
#32

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

this should be fixed, it may take an hour for update to process.



[TOPIC: post.html]
#33

rodrigopalmeira

[GLOBAL: userInfoPane.html]
rodrigopalmeira
  • Enthusiast

  • 50 posts
  • Corona SDK

Yeyyy! It worked!

 

Thanks Scott. Your are the Best!  :D

 

Captura_de_Tela_2016_12_06_a_s_08_44_04.



[TOPIC: post.html]
#34

rodrigopalmeira

[GLOBAL: userInfoPane.html]
rodrigopalmeira
  • Enthusiast

  • 50 posts
  • Corona SDK

Hi Scott.

 

I've tested in many types of Android devices. It worked in all devices, but it seems to be running very slow in devices with android version lower than 5.0.

 

My tests in 6 different devices with Android version HIGHER then 5.0: About 5 Seconds to Process.

My tests in 2 different devices with Android version LOWER then 5.0: About 1 Minute and 30 Seconds to Process.

 

What do you think may be happening? Just weaker OS's? 

Maybe an older and slower way of process contacts?



[TOPIC: post.html]
#35

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

My plugin just uses the native android way of getting contacts. Performance depends on may things device, os, and number of contacts



[TOPIC: post.html]
#36

howeyweb

[GLOBAL: userInfoPane.html]
howeyweb
  • Observer

  • 20 posts
  • Corona SDK

Scott, nope you can not run the simulator using your phone on Windows. Corona on windows is very limited I just hate using Mac.

 

I have well over 200 contact on my phone. The native pop is great for a single test. I not saying every single use or test. Without the pop a windows user has no idea if your contact plugin is working.

 

How about you supply an updated example showing the first 5 or so contacts. A simple for loop limit 5 or so should work. I think this would help with some of the question you're getting.

 

Scott I'm failing at the "simple for loop" :) Any assistance would be awesome



[TOPIC: post.html]
#37

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

Scott I'm failing at the "simple for loop" :) Any assistance would be awesome

local contacts = e.contacts
for i=1,#contacts do
	print(contacts[i].name)
end

this assumes e is the event



[TOPIC: post.html]
#38

raymondpineapple

[GLOBAL: userInfoPane.html]
raymondpineapple
  • Enthusiast

  • 33 posts
  • Corona SDK

Some questions of this plugin I want to ask, since these are the problems occurred in corona "native.showpopup"
1) Will this plugin shows all types of the contact, including custom label?

2) Will this plugin shows all records, including duplicated types? Since corona "native.showpopup" will not show the number with duplicated types



[TOPIC: post.html]
#39

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

1. I am guessing you mean like home and cell phone? please read docs on what data this plugin gets https://scotth.tech/plugin-contacts

I am not to familiar with custom labels.

2. It should return all contact records. I notice the work show a lot. This plugin allows you to get all contacts info and use it in a table. You can make your own pop if you want or display them all. contacts.get returns a lua table for you to filter, add, remove, etc and handle how ever you want.



[TOPIC: post.html]
#40

raymondpineapple

[GLOBAL: userInfoPane.html]
raymondpineapple
  • Enthusiast

  • 33 posts
  • Corona SDK

Since the document you mentioned is just said will display the following contact:

 

"mobile" (both)
"other" (both)
"work"(android)
"home" (android)
"main" (iOS)
"iPhone" (iOS)
"homeFax" (iOS)
"workFax" (iOS)
"otherFax" (iOS)
"pager" (iOS)
 
And iOS contact list has "custom label" (or you may call this "type") that can be created by user, so I want to know if that label can get in list


[TOPIC: post.html]
#41

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

I don't think so



[TOPIC: post.html]
#42

AdamBucketz

[GLOBAL: userInfoPane.html]
AdamBucketz
  • Observer

  • 2 posts
  • Corona SDK

Hey Scott, 

 

Looks like there's a conflict when using both your Contacts and Quick Action plugins. 

 

"There was a problem linking the app"

 duplicate symbol __ZN13PluginLibrary10InitializeEPv 

 

Help please, and thanks!



[TOPIC: post.html]
#43

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

^patched

[TOPIC: post.html]
#44

AdamBucketz

[GLOBAL: userInfoPane.html]
AdamBucketz
  • Observer

  • 2 posts
  • Corona SDK

Confirmed fixed! Thanks Scott  B)



[TOPIC: post.html]
#45

otkmember

[GLOBAL: userInfoPane.html]
otkmember
  • Observer

  • 2 posts
  • Corona SDK

Hi Scott.Thanks for great plugin. 

i have a question - is there any way to get the contact picture on iOS? 



[TOPIC: post.html]
#46

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,797 posts
  • Enterprise

Hi Scott.Thanks for great plugin. 

i have a question - is there any way to get the contact picture on iOS? 

Not at the moment



[TOPIC: post.html]
#47

otkmember

[GLOBAL: userInfoPane.html]
otkmember
  • Observer

  • 2 posts
  • Corona SDK

Not at the moment

ok. i got it.

one more thing - in the first try to get contact from device, after i give the permission, i got the app crash with such messages i get via my error handling

 

"model":"iPhone",

"errorMessage":"module 'plugin.contacts' not found:resource (plugin.contacts.lu) does not exist in archive no field package.preload['plugin.contacts']

 

and several messages like this ( $long app path on device$ is just a short for Users/Username/Library/Developer/CoreSimulator/Devices/someData/data/Containers/Bundle/Application/someData/appName/ - the same string everywhere. )

 

no file '/$long app path on device$/plugin/contacts.lua' 

no file $long app path on device$/plugin/contacts.lua'

no file '/$long app path on device$/corona-plugins/plugin/contacts.so'

no file './plugin/contacts.so'

no file '/$long app path on device$/plugin/contacts.so'

no file '/$long app path on device$/corona-plugins/plugin.so'

no file './plugin.so'

no file '/$long app path on device$/plugin.so'plugin.contactsluaopen_plugin_contacts", 

 

device is iPhone 5s

i hope it might be useful

 

the call is

 

local contacts = require ("plugin.contacts")

if ( contacts.canAccess() == "access granted" ) then
	contacts.get( M.listenerEndGetLocalContacts )

elseif(contacts.canAccess() == "not determined") then
	contacts.requestAccess(function( event )
		if (event.status == "access granted") then 
			contacts.get( M.listenerEndGetLocalContacts )
		end
	end)
end

build setting is

["plugin.contacts"] =
{
    publisherId = "tech.scotth",
    supportedPlatforms = { iphone = true }
},

on the second start all works fine.

am i doing something wrong?




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]

Also tagged with one or more of these keywords: ios, android