Blackberry

Developer Community Forums… Lead Your Development Conversation

 

blog1

Join the conversation, engage with peers, and get your Enterprise app questions answered. Be part of a Developer Community that is at the center of all information you need to stay connected with direct information for the world’s leading secure Development platform for Enterprise apps.

Get engaged with expert Devs from around the world including BlackBerry developers and technical experts, and updates on the latest news, code samples and resources as well as industry peer collaboration. Whether you are new to the platform or a seasoned developer, this community is a great way to keep plugged in to what’s happening on a regular basis. Also, you can add critical feedback ideas that can be incorporated in future product updates. Your input matters and is a valuable contribution to shaping solutions to similar challenges other developers are facing during their development project.

blog2

Remember… its not all work! Have a bit of fun, and gain points as you engage in the community, answer questions and connect with others with the same interests. These points add up giving you increased status, and possible nominations for our app awards handed out at our BlackBerry Developer Summits.

It’s easy… Click here to join the Developer Community and the Conversation!

Jump in and take a Developer Community Poll – How do you like to consume our Development content?

 


Source: Developer Blackberry

BlackBerry Dynamics Sample App: OpenURL (iOS)

 

picurl1picurl2

Screenshots of the splash screens

Of the many things that can be done with Blackberry Dynamics SDK, I wanted to demonstrate how to use the OpenURL API method in an iOS project.

The intended providers of this service would be browser-like applications that support HTTP/S protocol and can display the downloaded content. The caller application should yield the foreground to the service provider, so that service provider can display the content downloaded to the user.

There are numerous BlackBerry Dynamics sample apps made available to enterprise developers which demonstrate how the SDK easily integrates secure functionality within your app. Today we’ll focus on the OpenURL sample application and its usefulness.

After installing the Blackberry Dynamics SDK version 3.0.2.51(at the moment) to your XCode IDE, you can reference the collection of sample applications within the /Users/{UserName} /Library/ApplicationSupport/BlackBerry/Good.platform/iOS/Examples/objective-c directory.

Before running the sample apps you’ll need to configure them according to your use. In order to do so:

  1. Open com.good.gd.example.services.greetings.client and com.good.gd.example.services.greetings.server in XCode.

picurl3

2.  Change their Bundle Identifiers for both the apps.

picurl4

 

3.  Change their GDApplicationID and CFBundleURLTypes from Info.plist for both the apps.

picurl5

4.  Next thing to change is the Application Identifiers in both applications in the Constants.h file i.e kGreetingsClientAppId in GreetingsServer app and kGreetingsServerAppId in GreetingsClient app.

5.  Register the apps with the Good Control Server and you have two interacting applications to play with. Refer to the Getting Started Guide.

That is how we implement OpenURL in Objective-C. If you found this helpful please refer to our Github account and BlackBerry Dynamics developer website.

Happy Coding!


Source: Developer Blackberry

Charts for BlackBerry 10 Apps

http://www.jafed.xyz

Adding charts to apps has always been a problem for developers. There isn’t an easy solution that allows for simple integration of charts in a BlackBerry 10 app. To solve this problem I have developed, and added to the Cascades examples on GitHub, a project that shows how to insert a chart with a few simple steps, allowing the possibility of reusing existing code. The type of charts available are:

  • Bar
  • Line
  • Radar
  • Polar Area
  • Pie & Doughnut
  • Bubble

The system is based on the integration of a web page inside a QML page in which the chart will be shown using a WebView component. You create the datasets, the labels and the options of the charts inside a Javascript function in the QML page which is sent to the HTML page. In that HTML page, another Javascript function catches, evaluates, and uses them using the ChartJS library. Then it creates and shows the final chart inside the app. The HTML page can return a response message to the WebView that you could use for a several purposes: one of them is to encode the chart to Base64, to save the image of the chart.

charts-for-bb10-process

The Javascript library used is ChartJS. The library is simple to integrate and to use. See the link for the complete documentation and all relative examples: (www.chartjs.org).

Using ChartJS is simple and the official documentation of the library is very rich. The only modification that you must do to your HTML page is adding code to get the messages that the WebView sends (see this link: https://developer.blackberry.com/native/documentation/ui/webview/javascript.html to understand how the WebView communicates with a HTML page).

To catch the message containing all the data for the creation of the chart, we should insert the following Javascript function inside the HTML page. The body of this function will contain the code for the display of the chart.

navigator.cascades.onmessage = function onmessage(message) {
   /** create the chart here **/
}

In practice, we see that the HTML page will always remain the same, except some modifications for specific uses (for example, the settings of the tooltips, the visualization of the axis, and for the labels). The Javascript code included in the QML for the generation of the parameters that build the chart will change relative to our chart settings.

To generate these parameters you must insert a WebView component in the QML page with the path to the HTML file assigned to the URL property (it’s necessary to add local: at the path. Ex: “local:///assets/html/crazyCharts.html”). You must create a Javascript function (inside the project that is named as example: createChart) which has the task of generating the parameters for the chart. They’re the datasets that you want to display, the labels to visualize on the horizontal axis, and the options that you want to assign to the chart. This function will convert the created object into a JSON string, which is sent to the HTML page.

In the WebView event onLoadingChanged the function just created will be called to generate the chart when the HTML page loads.

To summarize:

  1. The createChart function generates everything necessary for the creation of the chart (datasets, labels, and options), converts the Javascript objects in a JSON string, and sends it to HTML page with the WebView postMessage event.
  2. The HTML page catches the event from the attached function with navigator.cascades.onmessage and creates the chart with the data decoded from the received JSON string.
  3. Optionally, the HTML page can return a Base64 format string that encodes the image of the chart.

We mentioned how the HTML page response sent back to the WebView may have several uses. Indeed, in some situations, it’s necessary to get the image of the chart just created to save or use it inside the app. For this we can use toBase64Image() a method, available from the ChartJS library, that encodes the image in a Base64 string.

After the creation of the chart, the Javascript function of the HTML page converts the chart into a Base64 string and sends it as the response to the WebView using the function navigator.cascades.postMessage(base64string); The WebView receives the response in the event onMessageReceived and passes the obtained string to a C++ method for the conversion and saving of the image in PNG format. This function takes the Base64 string and the path where the image will be saved as input parameters, and it returns true or false in case of successful or not.

In this way, it’s possible to use the image inside the app or to share it.

I’ve created an example project in the Cascades-Community-Samples on GitHub (https://github.com/blackberry/Cascades-Community-Samples) with the name ChartsForBB10. The app is composed of 7 Tabs, 6 of them for the creation of each supported chart type, and the seventh Tab for viewing custom charts and the optional saving function for each chart.

 


Source: Developer Blackberry

These events allow to you to share time with other replica watches sale watch lovers as well as learn about what the brands are up to. In the process, you'll get treated to rolex replica sale fabulous dinners, meet celebrities, receive gifts, and feel like a valued customer who the brands really want to rolex replica sale have a relationship with. Depending on where you live and the brands you like to purchase from, these events can be quite frequent, and also really fun. Their value should not be underestimated, and again, if you don't purchase rolex replica sale watches in an "official manner" you'll never be included. Personally, I have to say that while I don't like spending more money than I need to, the value of these above unexpected benefits, in many instances, can make up for the discounts replica watches available at gray market retailers when you want to buy a new watch. In a sense, each time you rolex replica sale purchase a high-end timepiece, you are designating yourself as part of a elite group of replica watches sale people who have the appreciation and resources for luxury items.