icesimon's Blog

  • About Me
  • Archive
  • feeds

Posts match “ Debug ” tag:

almost 9 years ago

How to debug webview inside the Cascades applications on BlackBerry 10

Developing on BlackBerry 10 is very easy in many phases.
By Native C/C++, HTML5, Adobe AIR, or Android, developers can easily bring their apps to this new platform.

I like to create "Hybrid App" on BlackBerry 10, whichcontains HTML5 and the native Cascades UI Framework.
The reason why I choose using hybrid apps are because by HTML5 I can do some drawing things, and by Cascades framework I can make my apps have uniformed UI and also the awesome native APIs!

Basically hybrid apps are using webview to load html files, but how can we debug the HTML code when them be wrapped into webview?

The answer is very easy! Use the WebInspector!

  1. Check the QML properties of WebView component, checked the "Web Inspector Enabled".

  2. Next, you can simply connect your devices / simulator to the computer, open the browser and type:

For USB connection: 169.254.0.1:1337
For Simulator of Wifi conection: IP + port 1337

  1. The view of connecting to webinspector

  2. Click into it and you can see the console!

See, is that easy?
Come and try to debug in WebInspector now :D

  • Cascades
  • Webview
  • HTML5
  • Debug
  • console
  • BlackBerry
  • Hybrid
  • May 30, 2014 17:35
  • Permalink
  • Comments
 
over 8 years ago

How to check debug messages in Cascades?

Just use some simple steps can let you check debug messages!

  1. Open the main.cpp in your project. Only need to add two code snippets!

  2. First: Insert this before int main

    void myMessageOutput(QtMsgType type, const char* msg) 
    

    {
    std::fprintf(stdout, "%s\n", msg);
    std::fflush (stdout);
    }

  3. Second:Inset snippet after Application app(argc, argv);

    qInstallMsgHandler(myMessageOutput);
    
  4. Here are the whole code snippets

    void myMessageOutput(QtMsgType type, const char* msg) 
    {
        std::fprintf(stdout, "%s\n", msg);
        std::fflush(stdout);
    }
    Q_DECL_EXPORT int main(int argc, char **argv) 
    {
        Application app(argc, argv);
        qInstallMsgHandler(myMessageOutput);
    
        // localization support
        QTranslator translator;
        QString locale_string = QLocale().name();
        QString filename = QString( "YourApp_%1" ).arg( locale_string );
        if (translator.load(filename, "app/native/qm")) 
        {
            app.installTranslator( &translator );
        }
        new YourApp(&app);
        return Application::exec();
    }
    

Enjoy all your dubeg messages! ^^

  • BlackBerry
  • Cascades
  • Debug
  • BB10
  • QML
  • c++
  • June 29, 2014 14:47
  • Permalink
  • Comments
 
over 8 years ago

[Tips] 'Unresponsive’ or ‘Unable To Terminate' your bb10 app when coding?

How To Squash ‘Unresponsive’ or ‘Unable To Terminate’ Errors When Debugging your BB10 App on Device

THERE ARE TWO WAYS TO RESOLVE THESE ERRORS

1) Restart your BB10 Dev Alpha, then turn Dev Mode on (take a few mins)

2) Kill the app manually via Momentics IDE I will show you how to quickly kill the app using the following steps. Follow along. (take a few seconds)

Open Target Navigator

Window - Show View - Target Navigator

Locate Device Process

Go Under Device Ip - Select Process

Send Signal To Application

Go Under Device Ip - Select Process - Right Click - Click Deliver Signal

Terminal Process/App Manually

Select SIGTERM option - Press OK

That’s it!

After you send the SIGTERM (Signal Terminate) your unresponsive app will disappear from the BB10 device. Success! Now, build (CTRL+B), deploy (CTRL+11) and test again.

  • Cascades
  • Debug
  • Tips
  • BlackBerry
  • Unresponsive
  • Unable-to-terminate
  • depoly
  • signal
  • SIGTERM
  • July 09, 2014 22:17
  • Permalink
  • Comments
 
over 7 years ago

Debug Tips for BB10 Headless apps.

Debug BB10 Headless Apps is really a hard topic for developers.
Before the latest Momentics update, debug is even harder..

By Momentics 2.1.2, developers can follow this instruction to debug your headless apps.

https://developer.blackberry.com/native/documentation/dev/tools/debugging_headless_apps.html

Here I am going to share my experience for debugging headless apps.
I put the logs into notification and show them in Hub!
If you have some problems on debugging headless apps on BlackBerry 10, maybe this trick can help you and save lots of time! :)

GOGOGO, keep developing on BlackBerry 10!

  • Tips
  • Momentics
  • Cascades
  • BlackBerry
  • BlackBerry10
  • headless
  • Debug
  • July 04, 2015 22:19
  • Permalink
  • Comments
 

Copyright © 2013 icesimon . Powered by Logdown.
Based on work at subtlepatterns.com.