You Are Here:

Community: Wiki

This page was last modified on 26 January 2009, at 06:36.

CS001280 - Checking memory card availability in Flash Lite

From Forum Nokia Wiki



ID CS001280 Creation date January 26, 2009
Platform S60 5th Edition Tested on devices Nokia 5800 XpressMusic
Category Flash Lite Subcategory Hardware


Keywords (APIs, classes, methods, functions): Service.SysInfo, sysInfo.GetInfo()

Overview

This code snippet demonstrates how to check if there is a memory card using the SystemInfo Platform Service for Flash Lite supported from S60 5th Edition onwards.

Source

// Import Platform Service Interface
import com.nokia.lib.Service;
// Heading of the application
heading_txt.text = "Checking Memory card existence";
 
// Create new Service object which has SystemInfo Service data
var sysInfo = new Service("Service.SysInfo", "ISysInfo");
 
// Define input parameters
var inParams = {Entity:"Memory", Key:"MemoryCard"};
 
// Retrieve information about a system attribute with a synchronous call
// Define result value
var outParams = sysInfo.GetInfo(inParams);
if (outParams.ErrorCode == 0) {
var systemData = outParams.ReturnValue;
var memoryCard = systemData.Status;
if(memoryCard == 1) {
text_txt.text = "Memory Card: Enabled";
} else {
text_txt.text = "Memory Card: Disabled";
}
} else {
var errorId = outParam.ErrorCode;
text_txt.text = "Error: "+errorId;
}text_txt.text = "Error: "+errorId;
}

Postconditions

Status of the memory card is displayed (disabled/enabled).

Example application

The following sample application has been tested in the Nokia 5800 XpressMusic (S60 5th Edition, Flash Lite 3.0).
File:FlashLite Checking Memory Card Existence.zip

See also

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia