×
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 - - Development)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix metadata)
Line 8: Line 8:
 
|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= [https://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 -->
 
|capabilities= <!-- Required capabilities for code (e.g. ID_CAP_LOCATION, ID_CAP_NETWORKING) -->
 
|capabilities= <!-- Required capabilities for code (e.g. ID_CAP_LOCATION, ID_CAP_NETWORKING) -->
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|translated-by= <!-- [[User:XXXX]] -->
 
|translated-by= <!-- [[User:XXXX]] -->
|translated-from-title= <!-- Title only - not link -->  
+
|translated-from-title= <!-- Title only - not link -->
 
|translated-from-id= <!-- Id of translated revision -->
 
|translated-from-id= <!-- Id of translated revision -->
|review-by=<!-- After re-review: [[User:username]] -->
+
|review-by= <!-- After re-review: [[User:username]] -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 
|update-by= <!-- After significant update: [[User:username]]-->
 
|update-by= <!-- After significant update: [[User:username]]-->
 
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 
|creationdate= 20131121
 
|creationdate= 20131121
|author=[[User:adarsha_saraff]]
+
|author= [[User:Adarsha saraff]]
 
}}
 
}}
  
Line 67: Line 67:
 
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.
 
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.
  
{{Note|Learn more about [[Nokia_notifications_on_the_Asha_software_platform |Nokia Notification]]. }}
+
{{Note|Learn more about [[Nokia notifications on the Asha software platform |Nokia Notification]]. }}
  
 
== Overview of Location Service ==
 
== Overview of Location Service ==
Line 96: Line 96:
 
         }.start();
 
         }.start();
 
</code>
 
</code>
{{Note| Learn more about [[Java_ME_Command_mapping_for_Nokia_Asha#Sensitive_API_calls_and_Command_handling|Sensitive API]].}}  
+
{{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| [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.}}   
  
Line 148: Line 148:
 
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 | Source]]
 
<br />
 
<br />
Client - [[File:Notification_API_and_location_service_for_localized_heath_training_javaMEapp.zip |Source]]
+
Client - [[File:Notification API and location service for localized heath training javaMEapp.zip |Source]]

Revision as of 07:41, 26 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 do not explains about Notification API or Location Service. 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 (26 Nov 2013)

Contents

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.

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.

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 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:

  • 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.

Note.pngNote: Learn more about Notification life cycle

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

The 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:

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

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.

Note.pngNote: Learn more about Nokia Notification.

Overview of Location Service

In Asha software platforms locations of user are calculated using:

  • Cell ID
  • Wi-Fi positioning.

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: Learn more about Sensitive API.

Note.pngNote: Asha 501 supports only Cell ID. While Asha 500, Asha 502, and Asha 503 supports both.

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

Service - File:Notification API and location service for localized heath training servicesource.zip
Client - File:Notification API and location service for localized heath training javaMEapp.zip

221 page views in the last 30 days.
×