5

I'm trying to migrate a Phonegap app wich uses jQuery Mobile to Blackberry. When I start the app, which runs fine on Android and iOS. I see no styles, javascript whatsoever.

I figured, that Blackberry webworks apps use different file paths than iOs and Android. I find this file path thing a bit odd in general.

Like when you use a file path in an HTML file like for <img src="res/img/..."> the normal relative path is fine for Android and iOS. BUT if you specify a file path in JS you need "file:///android_asset/www/res/img" for Android while "res/img/" is fine for iOS. But anyways... what's the case with Blackberry here?

Do external JavaScript and CSS files require something like the following?

<link rel="stylesheet" href="local:///lib/jquerymobile/jquery.mobile.min.css" />

or should it work the normal way by just specifinging the relative path?

Besides that, are there other pitfalls? Like I heard about file naming issues when using "dashes", "underscores", whatsoever.

Would be great if someone with exerience with Phonegap apps for BB could share their experiences.

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
j7nn7k
  • 17,995
  • 19
  • 78
  • 88

1 Answers1

3

This is what i have:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"  content="width=device-width, height=device-height,
    initial-scale=1.0, 'maximum-scale=1.0, 'minimum-scale=1.0, user-scalable=no" /> 

<!-- PhoneGAP   -->
<script src="json2.js" type="text/javascript"></script>
<script src="phonegap-1.0.0.js" type="text/javascript"></script>

<!-- JQuery Mobile  -->
<link rel="stylesheet" href="resources/jquery.mobile-1.0rc1/jquery.mobile-1.0rc1.min.css" /> 
<script src="resources/jquery-1.6.4.min.js"></script>
<script src="resources/jquery.cookie.js"></script>
<script src="resources/jquery.mobile-1.0rc1/jquery.mobile-1.0rc1.min.js"></script>

That´s the order that works, check the src attribs to know where you must copy the jqm library.

Good luck!

G-Nugget
  • 8,666
  • 1
  • 24
  • 31
  • THX. Knowing that the paths are not the problem helps me debuging. I figured that some error occurs when jquery mobile tries to manipulate some html element. I'll let you know which one it was. – j7nn7k Oct 10 '11 at 13:10
  • @JoheGreen, yes! Let me know, no problem :) You can try first to run the app on Ripple (a Chrome plugin to run phonegap apps!) – Mariano Montañez Ureta Oct 11 '11 at 14:18
  • I went with Ripple since that's the new solution RIM suggests. The app runs fine on Ripple. Since I have no RIM device I don't know how accurate Ripple behaves compared to a real device though... – j7nn7k Oct 11 '11 at 16:48
  • 1
    I test compare the result with the Emulator fo RIM with the Ripple one and the behaviour it´s the same. Plus i test on a BB8520 device and the result it´s the same too :). Only add that with Ripple is a good helper becouse it saves you a lot of time comparing with the traditional emulator, no need to ¨build and run¨ the projec in every change you made...only refresh your browser is needed. – Mariano Montañez Ureta Oct 12 '11 at 16:15
  • I agree. The emulator is a real productivity killer! THX for your insights! – j7nn7k Oct 16 '11 at 18:28