getting Contact Details from Android

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

getting Contact Details from Android

Post by hilton » Wed Jan 21, 2015 3:41 am

(livecode 7 7.0.0-rc-2 build 10016)

Hi folks,

I have an Android App written in another language that I am converting to Livecode as part of the process of learning livecode. Thus far I have managed most things, however, I am having trouble getting information from the mobile's contacts. The only info that seems to be retrieved is the firstname and lastname. Below is a snippet of code being used:

Code: Select all

on mouseUp
   local contId,contData
   if the environment is "mobile" then
      --user pick contact
      mobilePickContact
      put the result into contId
      --was one chosen?
      if contId is not empty then
         put mobileGetContactData(contId) into contData
         put contData["firstname"] && contData["lastname"] into field edtName
         put contData["note"] into field edtNotes
         put contData["email"]["home"][1] into field edtEmail
         put contData["phone"]["mobile"][1] into field edtMobile
         put contData["phone"]["home"][1] into field edtPhone
      end if
   end if
end mouseUp
Any ideas?

Thanks,
Hilton.

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: getting Contact Details from Android

Post by newtronsols » Wed Jan 21, 2015 10:12 pm

Yes I had a similar problem months ago:

http://stackoverflow.com/questions/2571 ... roid?stw=2

I was told it is not possible to get a contact photo with LC. Even though it is supposed to exist in the data row and also display photo as a file:

see: http://developer.android.com/reference/ ... Photo.html

In the end I had to give up with what I thought was fundamental to a phone - i.e. phone contact data and contact image/photo. I had a great idea for an app that was meaningless without the contact data on Android.

see also: http://quality.runrev.com/show_bug.cgi?id=11847 this is dated feb 2014.
and
http://forums.livecode.com/viewtopic.php?f=49&t=21538

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: getting Contact Details from Android

Post by hilton » Fri Jan 23, 2015 2:15 am

Hi newtronsols,

Getting Contact Details is a fundamental part of a couple of my apps. If nobody comes up with a bright idea in the next few days I will log this problem as a bug as the livecode documentation clearly says that it can be done! Whilst I am tempted to be a bit disappointed, I will resist the temptation and press on with my learning.

Anyway, it will be interesting to see if the livecode support will do something about it - my optimistic view is that they will. In large measure a product is as good as the support it gets.

Notwithstanding the above I am enjoying the process of learning.

Hilton.

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: getting Contact Details from Android

Post by newtronsols » Fri Jan 23, 2015 2:28 pm

I really like Livecode - I wish a big company like Google would buy and make it big. And put discipline into version control. I could have knocked out 20s of apps in 2014 if I didn't keep hitting problems in Livecode versions - functions that did then didn't work, then did then didn't work.

I may have the first recorded case of Livecode phobia. :oops:

For example I spent 2 weeks in Nov 2014 not realising I couldn't copy paste my data table from a previous working app. Many times I re-coded every thing around it & eventually gave up on a good idea as a result. I thought being able to copy/paste the good working bit from a previous app was fundamental.
Imagine if in Word they said you can copy/paste everything except data in tables.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: getting Contact Details from Android

Post by MaxV » Fri Jan 23, 2015 2:31 pm

What is the result of the following code? :?

Code: Select all

on mouseUp
   if the environment is "mobile" then
      --user pick contact
      mobilePickContact
      put the result into contId
      --was one chosen?
      if contId is not empty then
         put mobileGetContactData(contId) into contData
         put the keys of contData into myVariable
        sort lines of myVariable
        answer myVariable
      end if
   end if
end mouseUp
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: getting Contact Details from Android

Post by newtronsols » Fri Jan 23, 2015 2:41 pm

keys not supported android.

That is what is so frustrating with LC - everyone assumes because it works on Mac/iPhone....

Perhaps 40% of the functions on Mobgui don't work on Android. Yet we pay the same price - similarly LC.

Shouldn't we have a 40% Android dev discount?

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: getting Contact Details from Android

Post by hilton » Fri Jan 23, 2015 10:35 pm

Hi MaxV,

It returns "firstname" the contents of which is all I am getting.

Bye,
Hilton.

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: getting Contact Details from Android

Post by hilton » Sat Jan 24, 2015 7:59 am

Hi Folks,

I have submitted a bug report and the No. is

BUG 14438 Android - getting contact data from the phone

Now I will be able to see the level of support that Livecode supply.

At this stage I am resisting all urges to get frustrated. We all want everything to work for us, but the truth is that there is no perfect software. What really counts, as far as I am concerned, is the service one gets when there is a problem.

There have been a few other funnies, but generally I rather like Livecode and will press on learning it and trying to make things work.

Bye,
Hilton.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: getting Contact Details from Android

Post by MaxV » Mon Jan 26, 2015 1:37 pm

hilton wrote:Hi MaxV,

It returns "firstname" the contents of which is all I am getting.

Bye,
Hilton.
Did you try this?

Code: Select all

on mouseUp
   if the environment is "mobile" then
      --user pick contact
      mobilePickContact
      put the result into contId
      --was one chosen?
      if contId is not empty then
         put mobileGetContactData(contId) into contData
         put the keys of contData["firstname"] into myVariable
        sort lines of myVariable
        answer myVariable
      end if
   end if
end mouseUp
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: getting Contact Details from Android

Post by hilton » Mon Jan 26, 2015 10:00 pm

Hi MaxV,

Yes, I did and the result was as my previous post.

However, I have just received confirmation from Quality Control that it is indeed a bug that was possibly introduced in v7.0 dp 1.

Bye,
Hilton.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”