×
Namespaces

Variants
Actions
(Difference between revisions)

Notification API and location service for localized heath training

From Nokia Developer Wiki
Jump to: navigation, search
adarsha_saraff (Talk | contribs)
(Adarsha saraff -)
hamishwillee (Talk | contribs)
m (Hamishwillee - Minor subedit for wiki style - still going)
Line 1: Line 1:
[[Category:Nokia Asha]][[Category:How To]][[Category:Tutorial]][[Category:Java ME]]
+
[[Category:Location on Java ME]][[Category:UI on Java ME]][[Category:Nokia Asha]][[Category:Nokia Asha Platform 1.0]]
{{Abstract|This article explains how you can use [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications.html Nokia Notification API] and [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/location-services.html Location service] to create localized health application on Nokia Asha software platforms (Java ME). This article do not explains about Notification API or Location Service. However, a brief introduction with link to necessary resource is given to help beginners.}}  
+
{{Abstract|This article explains how you can use [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications.html Nokia Notification API] and [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/location-services.html Location service] to create localized health application on Nokia Asha software platforms (Java ME). This article does not explain the Notification API or Location Service in detail. However, a brief introduction with link to necessary resource is given to help beginners.}}  
 
{{Note|This is an entry in the [[Nokia Asha Wiki Competition 2013H2]].}}
 
{{Note|This is an entry in the [[Nokia Asha Wiki Competition 2013H2]].}}
  
Line 7: Line 7:
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.wgt]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.wgt]]) -->
 
|devices= RDA: Nokia Asha 501, Emulator: Nokia Asha 503.
 
|devices= RDA: Nokia Asha 501, Emulator: Nokia Asha 503.
|sdk= [https://developer.nokia.com/Develop/asha/java/tools.xhtml Nokia Asha SDK 1.1(beta)] or Nokia Asha SDK 1.0
+
|sdk= [http://developer.nokia.com/Develop/asha/java/tools.xhtml Nokia Asha SDK 1.1(beta)] or Nokia Asha SDK 1.0
 
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 
|signing= <!-- Special Signing requirements -->
 
|signing= <!-- Special Signing requirements -->
Line 24: Line 24:
  
 
== Introduction ==
 
== Introduction ==
During natural disaster, or mining affected areas relief camp, or medical camp are conducted. Sometimes health institutions, government, or charity organizations conduct free medical camp across the country. Even we can consider Red cross conducting blood donation camps. How successful the camp would go, if all people nearby area are not benefited from these camp. <br /><br />
+
 
Nokia Asha phones are cheaper phones and most of the people will have. Even if, 30-40% of the population of targeted area have Asha phones with them. Remaining 60-70% will also get information about the camp through oral communication. Thus 100% of the population will be benefited from the camp. Thus leading to successful camp.<br/><br/>
+
Sometimes health institutions, government, or charity organizations conduct medical camps - for example to manage relief efforts during a natural or man-made disaster, or in order to manage collection of blood. The key to the success of these camps is to ensure that both those in need of support and those that might like to give help receive timely notification of where they are and what they offer.
 +
 
 +
This article describes an app and service for registering to receive notification of medical camps in the user's area. As Nokia Asha devices are inexpensive, this approach provides a simple mechanism for notification of relevant health information that most users could afford.
  
 
It consists of two parts:
 
It consists of two parts:
*Mobile app which can be downloaded through Nokia Store.
+
* Mobile app which can be downloaded through Nokia Store.
 
*A service server which pushes the notification to desired user through Nokia Notification server.  
 
*A service server which pushes the notification to desired user through Nokia Notification server.  
  
Picture below describes the Idea in brief.
+
Picture below describes the idea in brief.
 
[[File:Notification API and location service for localized heath training Introduction Image.png |frame |none|Life cycle of Application]]
 
[[File:Notification API and location service for localized heath training Introduction Image.png |frame |none|Life cycle of Application]]
 
# User selects the best preferences suited for him and registers with Notification server.
 
# User selects the best preferences suited for him and registers with Notification server.
Line 45: Line 47:
  
 
== Overview of Notification API ==
 
== Overview of Notification API ==
The Nokia Notifications API makes it easy to add real-time push notifications to MIDlets running on Nokia Asha software platform devices.
+
 
Notification API has following features:
+
The Nokia Notification API and [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications.html Notification life cycle] is well documented in the Java Developers' Library and the article [[Nokia notifications on the Asha software platform]].
*[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications/client-features.html Nokia Notifications Client API] — Register the MIDlet to receive notifications from the notification service that is coupled with the MIDlet.
+
 
*[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications/service-features.html Nokia Notifications Service API] (REST API) — Sends notifications to the MIDlet from the notification service without a direct connection between service and device.
+
The Nokia Notifications API makes it easy to add real-time push notifications to MIDlets running on Nokia Asha software platform devices. It has the following features:
{{Note|Learn more about [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications.html Notification life cycle]}}
+
* [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications/client-features.html Nokia Notifications Client API] — Register the MIDlet to receive notifications from the notification service that is coupled with the MIDlet.
 +
* [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/key-features-of-nokia-notifications/service-features.html Nokia Notifications Service API] (REST API) — Sends notifications to the MIDlet from the notification service without a direct connection between service and device.
 +
 
 +
 
 
=== Registering for Notification Service ===
 
=== Registering for Notification Service ===
 
It is necessary to register your app with [https://account.nnapi.ovi.com/cm/Web/index.html Notification API developer console]. You need to acquire 3 required credentials before integrating it into your application. Those are:
 
It is necessary to register your app with [https://account.nnapi.ovi.com/cm/Web/index.html Notification API developer console]. You need to acquire 3 required credentials before integrating it into your application. Those are:
*service id
+
* service id
*application id
+
* application id
*service secret
+
* service secret
 +
 
 +
 
 +
=== Client development ===
 +
 
 +
[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/client-development.html Client development] is described in the Java Developer's library. The [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/client-development/client-api-reference.html Nokia Notifications Client API] allows MIDlets to receive notification state changes, notification information and notification messages.
  
===[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/client-development.html Client development] ===
+
To use the Nokia Notifications Client API in your MIDlet, you need to do the following:
The [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/client-development/client-api-reference.html Nokia Notifications Client API] allows MIDlets to receive notification state changes, notification information and notification messages.
+
To utilize Nokia Notifications Client API in your MIDlet, you need to do the following:
+
 
# Open a session.
 
# Open a session.
 
# Register the application.
 
# Register the application.
Line 64: Line 72:
 
# Handle Incoming Notifications.
 
# Handle Incoming Notifications.
  
===[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/service-development.html Service development]===
+
=== Service development ===
The Notifications Service API provides access to the Notification Server through an HTTP REST interface. REST API is platform and programming-language independent. Your service can be developed using any preferred environment and tools.
+
[http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/service-development.html Service development] is described in the Java Developer's library.  
  
{{Note|Learn more about [[Nokia notifications on the Asha software platform |Nokia Notification]]. }}
+
The Notifications Service API provides access to the Notification Server through an HTTP REST interface. REST API is platform and programming-language independent. Your service can be developed using any preferred environment and tools.
  
 
== Overview of Location Service ==
 
== Overview of Location Service ==
In Asha software platforms locations of user are calculated using:
+
In Nokia Asha software platform locations of user are calculated using:
 
*Cell ID
 
*Cell ID
 
*Wi-Fi positioning.
 
*Wi-Fi positioning.
  
Location API is an sensitive API and should be run on a separate thread.  
+
The Location API is an [[Java ME Command mapping for Nokia Asha#Sensitive API calls and Command handling|sensitive API]] and should be run on a separate thread.  
 
<code java>
 
<code java>
 
new Thread() {
 
new Thread() {
Line 96: Line 104:
 
         }.start();
 
         }.start();
 
</code>
 
</code>
{{Note| Learn more about [[Java ME Command mapping for Nokia Asha#Sensitive API calls and Command handling|Sensitive API]].}}
+
 
{{Note| [https://developer.nokia.com/Devices/Device_specifications/Asha_501/ Asha 501] supports only Cell ID. While [https://developer.nokia.com/Devices/Device_specifications/Asha_500/ Asha 500], [https://developer.nokia.com/Devices/Device_specifications/Asha_502/ Asha 502], and [https://developer.nokia.com/Devices/Device_specifications/Asha_503/ Asha 503] supports both.}}   
+
{{Note| [http://developer.nokia.com/Devices/Device_specifications/Asha_501/ Asha 501] supports only Cell ID location information while [http://developer.nokia.com/Devices/Device_specifications/Asha_500/ Asha 500], [http://developer.nokia.com/Devices/Device_specifications/Asha_502/ Asha 502], and [http://developer.nokia.com/Devices/Device_specifications/Asha_503/ Asha 503] support both Cell ID and Wifi positioning.}}   
  
 
== Development ==
 
== Development ==
Line 108: Line 116:
 
*An interface that list all the upcoming camps details received through notification payload.
 
*An interface that list all the upcoming camps details received through notification payload.
 
Payload data can be stored locally in mobile with Record Store.
 
Payload data can be stored locally in mobile with Record Store.
<br />
+
 
 
Implementation of the client app is left to reader's thought. However, a demo app have been developed to demonstrate the same.   
 
Implementation of the client app is left to reader's thought. However, a demo app have been developed to demonstrate the same.   
 
{{Note|Learn more on [[RMS complete reference|Record Store]].}}
 
{{Note|Learn more on [[RMS complete reference|Record Store]].}}
Line 118: Line 126:
  
 
=== Service Server ===
 
=== Service Server ===
Service Server will have a database system to store all the user preference, and service portal. It should have a program to map geo-coordinates into place name and store them in hierarchy of subdivision of the country. Service server is responsible for selecting desired user based upon the user's preferences and location.<br />
+
Service Server will have a database system to store all the user preference, and service portal. It should have a program to map geo-coordinates into place name and store them in hierarchy of subdivision of the country. Service server is responsible for selecting desired user based upon the user's preferences and location.
 +
 
 
The design and implementation of Service server is left to reader's thought as I don't have any deep knowledge regarding servers and service development.  
 
The design and implementation of Service server is left to reader's thought as I don't have any deep knowledge regarding servers and service development.  
 +
 
=== Service Portal ===  
 
=== Service Portal ===  
 
==== Design ====
 
==== Design ====
 +
 
Service portal facilitates camp organizer to schedule camp and send notification to desired user. Picture below shows a simple web portal. The design of service portal is not limited to this.   
 
Service portal facilitates camp organizer to schedule camp and send notification to desired user. Picture below shows a simple web portal. The design of service portal is not limited to this.   
 +
 
[[File:Notification API and location service for localized heath training serviceportal image.png|frame|none|Simple web portal to create new camp.]]
 
[[File:Notification API and location service for localized heath training serviceportal image.png|frame|none|Simple web portal to create new camp.]]
Notification REST API are platform independent. So portal can be an web page, web app, or an application which runs on various devices.<br/><br/>
+
 
 +
Notification REST API are platform independent. So portal can be an web page, web app, or an application which runs on various devices.
 +
 
 
==== Demo ====
 
==== Demo ====
Demo service portal application is build using Java. It is developed on the [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/service-development/service-example/java.html example] of service development from Java developer's library. However this demo application doesn't implements any of the design concepts explained above.<br />
+
 
 +
Demo service portal application is build using Java. It is developed on the [http://developer.nokia.com/Resources/Library/Java/#!developers-guides/nokia-notifications/developing-nokia-notifications/service-development/service-example/java.html example] of service development from Java developer's library. However this demo application doesn't implements any of the design concepts explained above.
  
 
== Screenshots ==
 
== Screenshots ==
<gallery widths="550px" heights="400px">
+
<gallery widths="300px" heights="400px">
 
File:Notification API and location service for localized heath training sc3.png|List of upcoming camps.
 
File:Notification API and location service for localized heath training sc3.png|List of upcoming camps.
 +
File:Notification API and location service for localized heath training sc4.png|Notification message shown in phone.
 +
</gallery>
 +
<gallery widths="550px" heights="400px">
 
File:Notification API and location service for localized heath training sc2.png|Service portal.
 
File:Notification API and location service for localized heath training sc2.png|Service portal.
 
File:Notification API and location service for localized heath training sc1.png|Sending push notification from server.
 
File:Notification API and location service for localized heath training sc1.png|Sending push notification from server.
File:Notification API and location service for localized heath training sc4.png|Notification message shown in phone.
 
 
</gallery>
 
</gallery>
  
Line 146: Line 163:
  
 
== Source ==
 
== Source ==
Service - [[File:Notification API and location service for localized heath training servicesource.zip | Source]]
+
* Service - [[File:Notification API and location service for localized heath training servicesource.zip]]
<br />
+
* Client - [[File:Notification API and location service for localized heath training javaMEapp.zip]]
Client - [[File:Notification API and location service for localized heath training javaMEapp.zip |Source]]
+

Revision as of 08:54, 27 November 2013

This article explains how you can use Nokia Notification API and Location service to create localized health application on Nokia Asha software platforms (Java ME). This article does not explain the Notification API or Location Service in detail. However, a brief introduction with link to necessary resource is given to help beginners.

Note.pngNote: This is an entry in the Nokia Asha Wiki Competition 2013H2.

Article Metadata
Tested with
SDK: Nokia Asha SDK 1.1(beta) or Nokia Asha SDK 1.0
Devices(s): RDA: Nokia Asha 501, Emulator: Nokia Asha 503.
CompatibilityArticle
Created: adarsha_saraff (21 Nov 2013)
Last edited: hamishwillee (27 Nov 2013)

Contents

Introduction

Sometimes health institutions, government, or charity organizations conduct medical camps - for example to manage relief efforts during a natural or man-made disaster, or in order to manage collection of blood. The key to the success of these camps is to ensure that both those in need of support and those that might like to give help receive timely notification of where they are and what they offer.

This article describes an app and service for registering to receive notification of medical camps in the user's area. As Nokia Asha devices are inexpensive, this approach provides a simple mechanism for notification of relevant health information that most users could afford.

It consists of two parts:

  • Mobile app which can be downloaded through Nokia Store.
  • A service server which pushes the notification to desired user through Nokia Notification server.

Picture below describes the idea in brief.

Life cycle of Application
  1. User selects the best preferences suited for him and registers with Notification server.
  2. After successful registration with notification server. App sends user preferences, location and Notification ID to service server.
  3. On the other hand. Camp organizer creates a camp event with the help of portal provided by service server.
  4. Server sends notification to Nokia Notification server with NIDs. Desired users are selected based on:
    1. User's preference.
    2. Camp priority and type.
    3. User's location. i.e how near the user resides to the camp.
  5. Nokia Notification Server delivers it to the user.

Finally a successful camp.
This is also a best way to carry out. Organizer need not to worry on creating awareness about the camp, instead he can spend time on planning the execution of camp. Server will have information about each and every user. Based on this we can even conclude on various needs.

Overview of Notification API

The Nokia Notification API and Notification life cycle is well documented in the Java Developers' Library and the article Nokia notifications on the Asha software platform.

The Nokia Notifications API makes it easy to add real-time push notifications to MIDlets running on Nokia Asha software platform devices. It has the following features:

  • Nokia Notifications Client API — Register the MIDlet to receive notifications from the notification service that is coupled with the MIDlet.
  • Nokia Notifications Service API (REST API) — Sends notifications to the MIDlet from the notification service without a direct connection between service and device.


Registering for Notification Service

It is necessary to register your app with Notification API developer console. You need to acquire 3 required credentials before integrating it into your application. Those are:

  • service id
  • application id
  • service secret


Client development

Client development is described in the Java Developer's library. The Nokia Notifications Client API allows MIDlets to receive notification state changes, notification information and notification messages.

To use the Nokia Notifications Client API in your MIDlet, you need to do the following:

  1. Open a session.
  2. Register the application.
  3. Retrieve the Notification ID and send to your server.
  4. Handle Incoming Notifications.

Service development

Service development is described in the Java Developer's library.

The Notifications Service API provides access to the Notification Server through an HTTP REST interface. REST API is platform and programming-language independent. Your service can be developed using any preferred environment and tools.

Overview of Location Service

In Nokia Asha software platform locations of user are calculated using:

  • Cell ID
  • Wi-Fi positioning.

The Location API is an sensitive API and should be run on a separate thread.

new Thread() {
public void run() {
LocationProvider myloc;
int[] type = {Location.MTE_CELLID | Location.MTY_NETWORKBASED | Location.MTA_ASSISTED};
try {
myloc = LocationUtil.getLocationProvider(type, null);
javax.microedition.location.Location Loc = myloc.getLocation(300);
if (Loc != null) {
QualifiedCoordinates cor = Loc.getQualifiedCoordinates();
lat = cor.getLatitude();
lon = cor.getLongitude();
System.out.println("Latitude:"+lat);
System.out.println("Longitude:"+lon);
}
} catch (Exception ex) {
}
}
 
}.start();

Note.pngNote: Asha 501 supports only Cell ID location information while Asha 500, Asha 502, and Asha 503 support both Cell ID and Wifi positioning.

Development

Mobile App

It is the client app. It facilitates the user to register and get notification about health camps from server.

Design

Mobile app should be simple to use. It can have the following features:

  • An interface which allows the user to subscribe and get register with the service server.
  • An interface that list all the upcoming camps details received through notification payload.

Payload data can be stored locally in mobile with Record Store.

Implementation of the client app is left to reader's thought. However, a demo app have been developed to demonstrate the same.

Note.pngNote: Learn more on Record Store.

Demo

Demo app doesn't Implements the server registration process. It implements only the major part which are required for demonstration. As I said earlier, implementation is left to your's thought.

User preference.

Note.pngNote: Learn more on J2ME app development.

Service Server

Service Server will have a database system to store all the user preference, and service portal. It should have a program to map geo-coordinates into place name and store them in hierarchy of subdivision of the country. Service server is responsible for selecting desired user based upon the user's preferences and location.

The design and implementation of Service server is left to reader's thought as I don't have any deep knowledge regarding servers and service development.

Service Portal

Design

Service portal facilitates camp organizer to schedule camp and send notification to desired user. Picture below shows a simple web portal. The design of service portal is not limited to this.

Simple web portal to create new camp.

Notification REST API are platform independent. So portal can be an web page, web app, or an application which runs on various devices.

Demo

Demo service portal application is build using Java. It is developed on the example of service development from Java developer's library. However this demo application doesn't implements any of the design concepts explained above.

Screenshots

Scope

Use of Nokia Notification in not only restricted to this. The same concept can be extend to various fields of Health care. Some of them are:

  • In medical stores to remind the refill of chronic medication practice for regular customers.
  • In hospital to remind the next appointment or next regular test for chronic disease patients.
  • Service portal for doctors.

Summary

The development of this type service portal not limited only to this. It can be extend in all directions. However, design and development of service server should not be generalized. Implementation of server should be done based on country. Country will have different type of hierarchy of subdivision.

Source

203 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×