Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
jvides
Posts: 4
Registered: ‎09-26-2012
My Device: BlackBerry Curve 9300

html5 webworks with ripple with files in php?

Hello!

 

I already can package my app with ripple, I signed my app and run into the simulator(bb curve 9300 phone)...all is ok the icon, the splash screen and works ok....but my problem is because my app(html5 website) work with a mysql all my files are in .php...so I need to know..

How can I run my app with these type of extension and connect to my remote server database?

 

I rreally hope that someone can give me a hand with it...

 

Best Regards!

 

Joaquin Vides

Regular Contributor
kokoman
Posts: 76
Registered: ‎11-13-2012
My Device: curve 9300

Re: html5 webworks with ripple with files in php?

Are u aware about the access feature, what you av to do is host a webserver that part of your app that has extension .php and connects to a database, for more details just visit developers.blackberry.com/html5
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: html5 webworks with ripple with files in php?

Hello Joaquin, as kokoman pointed out, the PHP part of your application will need to be hosted on an external server. BlackBerry devices don't have a PHP runtime to be able to execute PHP directly on the device.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: html5 webworks with ripple with files in php?

You should probably look at creating a web service on the hosted external website.

 

Reasons:

1.  You shouldn't expose your database to apps not hosted on your server - I mean your allowing devices to connect directly to the MySQL data.

 

2.  If things need to change in the schema of the database you can do that without cutting users off by shaping your web service to the old.

If it helped you, click like. :smileyhappy:
New Contributor
jvides
Posts: 4
Registered: ‎09-26-2012
My Device: BlackBerry Curve 9300

Re: html5 webworks with ripple with files in php?

ok, I  make it different because BB don´t  support .php...

 

so I put in eclipse the BB sdk and find this code...

 

import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.io.transport.ConnectionFactory;
import net.rim.device.api.io.transport.TransportInfo;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;

class Main extends UiApplication
{
    private MainScreen screen;
    private BrowserField bf2;
    private BrowserFieldConfig config;
    private ConnectionFactory factory;

    public Main()
    {
        factory = new ConnectionFactory();
        factory.setPreferredTransportTypes( new int[] {
                               TransportInfo.TRANSPORT_TCP_WIFI
        });
        factory.setDisallowedTransportTypes(new int[] {
                                TransportInfo.TRANSPORT_TCP_CELLULAR,
                                TransportInfo.TRANSPORT_WAP
        });
        factory.setAttemptsLimit(10);
        factory.setConnectionTimeout(10000);
        factory.setTimeLimit(10000);
        config = new BrowserFieldConfig();
        config.setProperty(BrowserFieldConfig.CONNECTION_FACTORY, factory);
        bf2 = new BrowserField(config);

        screen = new MainScreen();
        screen.add(bf2);
        pushScreen(screen);

        bf2.requestContent("http://www.google.com");
    }

    public static void main(String[] args)
    {
        Main app = new Main();
        app.enterEventDispatcher();
    }
}

 

I suppose working..... in the simulator open the app but give me this error

 

the url:  could not select proper transport descriptor for: the url in question

 

 

so I think is because I don't put the whitelist...and I don´t know where I need to put it...can you give me a clue?

 

Best Regards

 

Joaquin

BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: html5 webworks with ripple with files in php?

Just to confirm, are you able to browse to http://www.google.com directly from the simulator native browser on the device? (i.e. not through a third-party app.) That would help determine whether it is an application issue or simulator issue. You can find information on white-listing here: https://developer.blackberry.com/html5/documentation/access_element_834677_11.html

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
jvides
Posts: 4
Registered: ‎09-26-2012
My Device: BlackBerry Curve 9300

Re: html5 webworks with ripple with files in php?

hello oros, thank you for your support!

 

yes with the native browser I can even see my mobile website, but with the app can not...

 

yes I know the code:

 

<access uri="the url" subdomains="true">
   <feature id="blackberry.pim.memo" required="true" version="1.0.0"/>
</access>
 
The thing I dont know is where in eclipse put that code(in java file or inside of bb_App_Descriptor.xml) or if is diferent the syntaxis to put it
 
Best regards
 
Joaquin
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: html5 webworks with ripple with files in php?

Hi Joaquin,

 

That code would go in your config.xml document. The config.xml document exists at the root of your project and contains identifying information about your application:

https://developer.blackberry.com/html5/documentation/creating_a_bb10_app_2007539_11.html

 

Also, please note that the WebWorks plug-in for Eclipse hasn't been supported in quite some time; while you can still use Eclipse as an editor, the actual packaging of the applicatoin be being done through Ripple or the command line, using the most up-to-date WebWorks SDK. Information on packaging is also available at the URL above.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: html5 webworks with ripple with files in php?

Sorry, I was a little confused.

 

Just to clarify, are you making a Java applicatoin (i.e. the BrowserField source code you posted) or a WebWorks application (i.e. HTML5 packaged applicatoin.) The <access> element is only applicable to WebWorks applications.

 

In a Java application, you don't need to perform the same whitelisting.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.