You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Christian Grobmeier <gr...@gmail.com> on 2011/11/26 15:17:49 UTC

Different versions of phonegap.js

Hello guys,

I created a phonegap project with Xcode and one for Eclipse. Then I
compared the phonegap.js files of each of them and found out they are
very different to each other. In my case, using the Android-Phonegap
file does not catch the "deviceready" event on the iPhone simulator.

Now I am a bit confused - I thought I could use exactly the same code
for both devices. Do I need to replace these different phonegap.js
files on buildtime? I could not find anything about that on the net.
Hints appreciated!

Cheers,
Christian


-- 
http://www.grobmeier.de
https://www.timeandbill.de

Re: Different versions of phonegap.js

Posted by Brian LeRoux <b...@brian.io>.
Pretty much the brute force copy/paste. You never get exposed to the
native build artifacts/projects with build.phonegap.com --- something
we'd like to gun for in the phonegap project itself but recognize that
access to the tooling local to the device platform is still super
important. For now. ;)


On Mon, Nov 28, 2011 at 12:26 AM, Christian Grobmeier
<gr...@gmail.com> wrote:
> Thanks Brian for explaining my options, now I can decide how to deal with it.
> I am curious how build@phonegap handles this?
>
> On Mon, Nov 28, 2011 at 2:59 AM, Filip Maj <fi...@adobe.com> wrote:
>> If more people contribute to http://github.com/callback/callback-js we can
>> bring the future sooner :D
>
> Thanks for pointing me to that :-) I would love to help, but I am
> unsure if I have the skills/time to do so. But I will look into that,
> thanks again.
>
> Cheers
>
>>
>> On 11-11-26 8:09 AM, "Brian LeRoux" <b...@brian.io> wrote:
>>
>>>> And how do I deal with that now?
>>>
>>>There are three ways:
>>>
>>>- simlink www (and phonegap.js gets built/copied into your project on
>>>platform by platform basis)
>>>- git submodules (or if you prefer svn externals)
>>>- brute force copy/past of www into appropriate native directories
>>>using a bash script (example of such a project can be seen here:
>>>https://github.com/brianleroux/Cordova/tree/master/generate-template
>>>w/ scripts living in the bin directory)
>>>
>>>Like Simon said, we're hoping to unify the JS (as per the other email
>>>threads) sometime in the near future.
>>
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>

Re: Different versions of phonegap.js

Posted by Christian Grobmeier <gr...@gmail.com>.
Thanks Brian for explaining my options, now I can decide how to deal with it.
I am curious how build@phonegap handles this?

On Mon, Nov 28, 2011 at 2:59 AM, Filip Maj <fi...@adobe.com> wrote:
> If more people contribute to http://github.com/callback/callback-js we can
> bring the future sooner :D

Thanks for pointing me to that :-) I would love to help, but I am
unsure if I have the skills/time to do so. But I will look into that,
thanks again.

Cheers

>
> On 11-11-26 8:09 AM, "Brian LeRoux" <b...@brian.io> wrote:
>
>>> And how do I deal with that now?
>>
>>There are three ways:
>>
>>- simlink www (and phonegap.js gets built/copied into your project on
>>platform by platform basis)
>>- git submodules (or if you prefer svn externals)
>>- brute force copy/past of www into appropriate native directories
>>using a bash script (example of such a project can be seen here:
>>https://github.com/brianleroux/Cordova/tree/master/generate-template
>>w/ scripts living in the bin directory)
>>
>>Like Simon said, we're hoping to unify the JS (as per the other email
>>threads) sometime in the near future.
>



-- 
http://www.grobmeier.de
https://www.timeandbill.de

Re: Different versions of phonegap.js

Posted by Filip Maj <fi...@adobe.com>.
If more people contribute to http://github.com/callback/callback-js we can
bring the future sooner :D

On 11-11-26 8:09 AM, "Brian LeRoux" <b...@brian.io> wrote:

>> And how do I deal with that now?
>
>There are three ways:
>
>- simlink www (and phonegap.js gets built/copied into your project on
>platform by platform basis)
>- git submodules (or if you prefer svn externals)
>- brute force copy/past of www into appropriate native directories
>using a bash script (example of such a project can be seen here:
>https://github.com/brianleroux/Cordova/tree/master/generate-template
>w/ scripts living in the bin directory)
>
>Like Simon said, we're hoping to unify the JS (as per the other email
>threads) sometime in the near future.


Re: Different versions of phonegap.js

Posted by Brian LeRoux <b...@brian.io>.
> And how do I deal with that now?

There are three ways:

- simlink www (and phonegap.js gets built/copied into your project on
platform by platform basis)
- git submodules (or if you prefer svn externals)
- brute force copy/past of www into appropriate native directories
using a bash script (example of such a project can be seen here:
https://github.com/brianleroux/Cordova/tree/master/generate-template
w/ scripts living in the bin directory)

Like Simon said, we're hoping to unify the JS (as per the other email
threads) sometime in the near future.

Re: Different versions of phonegap.js

Posted by Christian Grobmeier <gr...@gmail.com>.
Thanks for the prompt response Simon.

And how do I deal with that now?
Is the current recommendation to make up two different projects and
copy/paste own business logic between them?

On Sat, Nov 26, 2011 at 3:20 PM, Simon MacDonald
<si...@gmail.com> wrote:
> The .js file are platform dependent. The API exposed is the same though.
> People are working on making the .js the same for all platforms.
>
> Simon
>
> On Saturday, November 26, 2011, Christian Grobmeier <gr...@gmail.com>
> wrote:
>> Hello guys,
>>
>> I created a phonegap project with Xcode and one for Eclipse. Then I
>> compared the phonegap.js files of each of them and found out they are
>> very different to each other. In my case, using the Android-Phonegap
>> file does not catch the "deviceready" event on the iPhone simulator.
>>
>> Now I am a bit confused - I thought I could use exactly the same code
>> for both devices. Do I need to replace these different phonegap.js
>> files on buildtime? I could not find anything about that on the net.
>> Hints appreciated!
>>
>> Cheers,
>> Christian
>>
>>
>> --
>> http://www.grobmeier.de
>> https://www.timeandbill.de
>>
>
> --
> Simon Mac Donald
> http://hi.im/simonmacdonald



-- 
http://www.grobmeier.de
https://www.timeandbill.de

Re: Different versions of phonegap.js

Posted by Simon MacDonald <si...@gmail.com>.
The .js file are platform dependent. The API exposed is the same though.
People are working on making the .js the same for all platforms.

Simon

On Saturday, November 26, 2011, Christian Grobmeier <gr...@gmail.com>
wrote:
> Hello guys,
>
> I created a phonegap project with Xcode and one for Eclipse. Then I
> compared the phonegap.js files of each of them and found out they are
> very different to each other. In my case, using the Android-Phonegap
> file does not catch the "deviceready" event on the iPhone simulator.
>
> Now I am a bit confused - I thought I could use exactly the same code
> for both devices. Do I need to replace these different phonegap.js
> files on buildtime? I could not find anything about that on the net.
> Hints appreciated!
>
> Cheers,
> Christian
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>

-- 
Simon Mac Donald
http://hi.im/simonmacdonald