Tag Archive for 'Nokia'

Contacts Demo – S60 Platform Services API example with Flash Lite

Here is my first Nokia S60 Platform Services API test with Adobe Flash Lite. This demo is designed to run 360x640 screens (like Nokia 5800 and N97). Application first loads contacts name, phone number, work and home addresses and shows all informations nicely in interactive scrollable menu.

Contacts Demo scr 1 Contacts Demo scr 2

 
// create contacts service object
var contact = new Service("Service.Contact","IDataSource");
var inParams = {Type:"Contact"};
// get contacts from phone
var outParams = contact.GetList(inParams);
if (outParams.ErrorCode == 0) {
  var outList = outParams.ReturnValue;
  var outputEntry = null;
  var i:Number = 0;
  var step:Number = 40;
  do {
    outputEntry = outList.next();
    if (null != outputEntry) {
    // add a new contact to container list
    i++;
    var mc:MovieClip = container_mc.attachMovie("ContactItem","Contact"+i,
      container_mc.getNextHighestDepth());
    container_mc.addMC(mc);
    container_mc["Contact"+i].init(outputEntry, container_mc, i,
    contactheader_fmt, contactdata_fmt);
    container_mc["Contact"+i]._y = (i-1)*step;
  } else { break; }
} while (true);
  // show contact list
  gotoAndStop("show");
} else {
  info_txt.text = outParams.ErrorCode;
}

Details of contact information are displayed when user presses contacts name. Multiple contacts can be open at the same time. If contact has work or home address, this demo applications can load static JPG from Google Maps to show address in a map.

Contacts Demo scr 2 Contacts Demo scr 3

 
// data objects to server and back
var sendDataLV:LoadVars;
var loadDataLV:LoadVars;
// show map loading info to user
var info_mc:MovieClip;
 
//start loading request
function showInMap(street:String,city:String,country:String):Void {
  sendDataLV = new LoadVars();
  loadDataLV = new LoadVars();
  info_mc = _level0.attachMovie("info","info_mc",
    _level0.getNextHighestDepth());
  info_mc._x = 5;
  info_mc._y = 70;
  loadDataLV.onLoad = latLonLoaded;
  sendDataLV.address = street+" "+city+" "+country;
  _level0.info_mc.text_txt.text += "street : " + street + "\n";
  _level0.info_mc.text_txt.text += "city : " + city + "\n";
  _level0.info_mc.text_txt.text += "country : " + country + "\n";
  // send lat and lng request to server
  sendDataLV.sendAndLoad(phpUrl,loadDataLV,"POST")
  _level0.info_mc.text_txt.text += "Get lat and lng...\n";
  back_mc._visible = true;
}
 
// lat and lng returned from server
function latLonLoaded(ok:Boolean):Void {
  if (ok) {
    if (loadDataLV.latitude != undefined &&
        loadDataLV.longitude != undefined) loadMap();
    else _level0.info_mc.text_txt.text += "No Lat and Lng!\n";
  } else {
    loadDataLV = null;
    sendDataLV = null;
    _level0.info_mc.text_txt.text += "Can't connect server to get Lat and Lng!\n";
  }
}
 
// start loading map from Google
function loadMap():Void {
  // show info
  _level0.info_mc.text_txt.text += "Loading map...\n";
  _level0.info_mc.text_txt.text += "Latitude: "+loadDataLV.latitude+"\n";
  _level0.info_mc.text_txt.text += "Longitude: "+loadDataLV.longitude+"\n";
  // map size
  var mapWidth = 350;
  var mapHeight = 520;
  // lat and lng
  var lat = loadDataLV.latitude;
  var lng = loadDataLV.longitude;
  var apiKey = 'API_KEY';
  // JPG loader
  var loader:MovieClipLoader = new MovieClipLoader();
  // url
  var mapUrl:String = 'http://maps.google.com/staticmap?center=' +
    lat + ',' + lng + '&format=jpg&zoom=15&size=' +
    mapWidth + 'x' + mapHeight + '&key=' + apiKey +
    "&markers="+lat+","+lng+","+"greena";
  // start map load
  loader.loadClip(mapUrl, _level0.info_mc.map_mc);
  _level0.info_mc.text_txt.text += "Loading, please wait...\n";
}

Contacts Demo scr 4 Contacts Demo scr 5

Look more detailed informations in source codes:
- ContactsDemo_PTM.zip (include CS4 FLA, AS class files and PHP files)
- ContactsDemo_PTM.zip (includes only CS3 FLA):
- ContactsDemo.fla
- Contact.as
- Menu.as
- and a few PHP files to get Lat and Lng values from Google Maps.

S60 Platform Services — Reaching Further with Flash on Nokia Devices

Via Forum Nokia there will be excellent Flash Lite webinar coming in January 28.

"This webinar will look at the new S60 5th Edition Platform Services and how Flash developers can make use of them. Nokia will give an overview of the opportunities on offer and the techniques used to access location, sensor, calendar, contacts, and other functionality in your Flash and web applications. Join us to learn about some practical examples of how you can use S60 Platform Services to extend what Flash Lite can do on Nokia platforms."

January 28
EMEA Session: 10 a.m. London, noon Helsinki
Register »

January 29
Americas Session: 7 a.m. San Francisco, 9 a.m. Dallas, 10 a.m. New York
Register »

Flash Lite sessions in MAX 2008 Milan

There are excellent mobile sessions in Milan too - unfortunately I don't have money to participate there too. If you are going you should attend in these sessions:

Flash Monkey Max the Explorer

Flash Lite Programming for Nokia Devices - Technical Session
This session will give you an insight to the latest development opportunities offered by Nokia and touch on new capabilities and devices. Nokia will give you a practical overview on security, packaging and distribution. From Flash, to Web Runtimes, to integrated services - learn how Nokia is making it easier for design and web professionals to create content for mobile markets.

Speakers:        Riku Salminen
When:             Tuesday, December 2, 1:30 pm - 2:30 pm

Nokia Round Table - Open Session
Open round table meeting - a chance to air development issues and to meet and make contact with some of the Nokia team. We are looking to share current technology thinking - and get feedback on our developer support. Book a time at our booth if you wish to have direct meeting.

Speakers:       You & Nokia team
When:            Tuesday, December 2 4:00 pm - 5:30 pm

Flash and the Mobile Browser - General Session
This session explores the commercial opportunities for Flash and web developers. Using the web skills you already have, see how you can easily extend content to better serve a mobile audience and build customer retention. We will give an overview of the technology - and focus on the business opportunities offered by Nokia platforms. All attendees will get a chance to win a Nokia device and other prizes.

Speakers:        Stephen Ellis
When:             Wednesday, December 3, 10:15 am - 11:15 am

Calling All Innovators application contest from Forum Nokia

Nokia Application Contest

Forum Nokia launches Calling All Innovators application contest and there are Flash Lite included. You have the chance to showcase and distribute your most innovative ideas to the largest audience of mobile device owners around the world. Winning developers will:

  • Showcase their applications at Mobile World Congress in Barcelona, Spain
  • Participate in "meet and greets" with Industry leaders, VC's, Mobile Operators and distributors
  • Win CASH up to $25,000 (USD).

The Forum Nokia Calling All Innovators Competition is open to all mobile application developers, and features three distinct categories for submissions:



Get Adobe Flash playerPlugin by wpburn.com wordpress themes