Page 1 of 1

getting Contact Details from Android

Posted: Wed Jan 21, 2015 3:41 am
by hilton
(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.

Re: getting Contact Details from Android

Posted: Wed Jan 21, 2015 10:12 pm
by newtronsols
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

Re: getting Contact Details from Android

Posted: Fri Jan 23, 2015 2:15 am
by hilton
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.

Re: getting Contact Details from Android

Posted: Fri Jan 23, 2015 2:28 pm
by newtronsols
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.

Re: getting Contact Details from Android

Posted: Fri Jan 23, 2015 2:31 pm
by MaxV
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

Re: getting Contact Details from Android

Posted: Fri Jan 23, 2015 2:41 pm
by newtronsols
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?

Re: getting Contact Details from Android

Posted: Fri Jan 23, 2015 10:35 pm
by hilton
Hi MaxV,

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

Bye,
Hilton.

Re: getting Contact Details from Android

Posted: Sat Jan 24, 2015 7:59 am
by hilton
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.

Re: getting Contact Details from Android

Posted: Mon Jan 26, 2015 1:37 pm
by MaxV
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

Re: getting Contact Details from Android

Posted: Mon Jan 26, 2015 10:00 pm
by hilton
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.