You are on page 1of 17

GeoAmidaSDKDocument

Version1.0

TableofContents
1.GeoAmidaSDKArchitecture...........................................................................................................1 2.GeoAmidaProgramming..................................................................................................................2 AmidaEmulator...............................................................................................................................2 ConnectingGeoAmidatothePC.....................................................................................................2 Pwrap2.............................................................................................................................................7 GeoAmidaPeripheralsProgramming..............................................................................................7 AddingiconintheLauncher............................................................................................................7 ChangingLauncherbackgroundimage...........................................................................................7 AddinganentryintheSystempanel...............................................................................................8 Runningprogramsautomaticallyduringstartup.............................................................................8 PlayingAudiofiles..........................................................................................................................8 DebuggingApplications..................................................................................................................8 3.GeoAmidaSoftwarePackageManagement.....................................................................................9 Introduction......................................................................................................................................9 Advancedfeatures..........................................................................................................................11 4.ChangesinPwrap2.........................................................................................................................12 5.ChangesinGeoAmidasoftware.....................................................................................................13 From4.4to6.1...............................................................................................................................13 6.ChangesinSDKversions...............................................................................................................14 APIchangesfrom4.4to6.1...........................................................................................................14

GeoAmidaSDKDocument

1.GeoAmidaSDKArchitecture
TheGeoAmidaSDKArchitectureisshownintheimagebelow:

AnapplicationprogrammingrunningonGeoAmidacanmakeuseofseverallibraries.Theabove imageshowssoftwarelayeronGeoAmida.Itemsshownintheaboveimageareexplainedbelow: Linuxkernel:GeoAmidausesthecustommodifiedGNU/Linux2.6.26kernel. LibC:TheClibrarywhichprovidessystemcallsandotherbasicfacilities. Xlib:ThelibaryfortheXWindowsystem. Alchemy:Awindowmanagertomanageapplicationsonthedevice. Pwrap2:Awidgetlibrary,whichprovidesUserInterfaceelementstobuildapplicationson GeoAmida. Biometric,Smartcard,Printer,GPRS,GPSlibraries:Theselibrariesallowtheapplicationsto accesstherespectivecomponents. Apartfromtheabove,GeoAmidahasseveralotherlibrarieslikecurl,sqlite,libusb,inotify,openssl, bluez,libxml,glib,etc.,availableforapplications.

GeoAmidaSDKDocument

2.GeoAmidaProgramming
GeoAmidaSDKcanbeinstalledonaUbuntuLinux(8.04/9.04/10.04)PC,afterdownloadingitfrom theGeoAmidawebsite.CandC++arethepreferredprogramminglanguagesfordevelopment.The SDKcomesalongwithCandC++crosscompilers.

AmidaEmulator
TheUserInterface(UI)developmentforaGeoAmidaapplicationcanbedoneonaPC.Anemulator isprovidedalongwiththeSDKtodevelopanddebugapplications.Thedevelopermayusethe #ifdef __arm__ Cpreprocessorintheirsourcecode,tomakeportionsoftheirprogramrun onlyonthedevice.Thiswaytheycanputtheperipheralspecific(printer,biometric,smartcard,etc) codewithinthatCpreprocessorandmaketheprogramtobeabletorunonPCaswell. TheemulatorcanbestartedonaPCusingtheamida_emulator.shcommand.Thisisshownin theimagebelow:

An amida shell will be started in the terminal where amida emulator was started. All the developmentandrunningsampleSDKprogramsmustdoneinthisshell.

ConnectingGeoAmidatothePC
GeoAmidacanbeconnectedtoaPCusingUSBcablehavingmaleMiniUSB(5Pin)Btypeonone endandmaleAtypeontheotherend.TheBtypegoestotheGeoAmidaandAtypegoestothe PC.ThefollowingimageshowstheparticularUSBcable:

GeoAmidaSDKDocument

BeforeloggingintotheGeoAmidaortransferfiles,theuserwillhavemakefewonetimesettingson PCandGeoAmida. PCsettings(ThisisnotrequiredonUbuntuLinux8.04PC) Make sure thattheGeoAmidaSDK isinstalledonthePC.Startthe Network Connections application from the desktop System > Preferences > Network Connections menu item. The NetworkConnectionsdialogboxappearsasfollows:

IntheNetworkConnectionsdialogboxselectAutoamida10kandclickEdit.

GeoAmidaSDKDocument

Inthe EditingAutoamida10k dialogboxthatappears,choosethe IPv4Settings taband select Method as Manual.Makesurethatthe Connectautomatically isselected.Then click Add and enter 192.133.133.2 and 255.255.255.0 for Address and Netmask respectively.ThefollowingimageshowstheconfiguredEditingAutoamida10kdialogbox:

ClickApplytosavethesettings. GeoAmidasettings OntheGeoAmidatopbar,clickthe icontostarttheSystemPanelapplication.TheSystem Panelappearsasshownintheimagebelow:

GeoAmidaSDKDocument

InthatchooseAdvancedandenterthepasscodeas1234.Thefollowingscreenappears:

Inthisscreen,selectMiniUSBsystempanelentryandmakesurethatthefollowingsettingsare made:

GeoAmidaSDKDocument

Incase,ifanychangesaremade,clickSave. Thenselectthe SSHLogin systempanelentryandmakesurethatthefollowingsettingsare done:

ClosetheSystemPanelafterthesesettings. LoggingintotheGeoAmidaandtransferingfiles AftertheabovesettingsaremadeandtheGeoAmidaisconnectedtothePC,theutilitieslikeSSH and SCP can beusedforloginandfiletransfer.TheSDK provides awrapperutlitycalled as

GeoAmidaSDKDocument

amida_connecttologintothedevice.Runthiscommandandentertheusernameandpassword asrootandamidatogetaGeoAmidashellpromt. ThecommandscpcanbeusedasfollowstotransferfilesfromPCtoGeoAmida: scp file root@amida10k:/tmp ThesamescpcommandonGeoAmidacanbeusedtotransferfilestothePCasfollows: scpfileuser@pc:/tmp

Pwrap2
Pwrap2isaUItoolkitlibraryusedtodevelopGUI(GraphicalUserInterface)basedapplicationson GeoAmida.ThelibraryisdevelopedinCprograminglanguageandcanbeusedwithapplications developedusingCandC++.Pwrap2providesseveralUIwidgetslikelabel,button,entrybox,text box,spinner,etc,.Aeventcallbackbasedmechanismisused,whiledevelopingapplicationsusing Pwrap2.SeveralexampleprogramsandAPIdocumentationareprovidedintheSDKforfurther exploration. ThechapterChangesinPwrap2inthisdocumentlistsoutthechangesinPwrap2withrespectto Pwrap.

GeoAmidaPeripheralsProgramming
GoeAmidahasseveralperiperalslikebiometricsensor,smartcard(contactandcontactless),printer, GPRSandGPS.ClibrarieswitheasytouseAPIshavebeenprovidedtoprogramthese.Several exampleprogramsandAPIdocumentationareprovidedintheSDKforfurtherexploration.

AddingiconintheLauncher
Aniconcanbeaddedinthelauncherbycreatingafileinthe/usr/local/apps/infosdirectoryonthe GeoAmida. The file must have a .info filename extension and contain 4 lines, with each line representingthefollowing:

Line1:Pathtotheexecutableprogram,whichhastobeinvokedwhentheiconisclicked. Line2:Pathtotheiconimage,tobedisplayedinthelauncher.TheimagecanbeaJPEG, PNG,BMPorGIFfilewitharesolutionof90x82pixels. Line3:ACaptionthathastoappearbelowtheiconinthelauncher. Line4:Anumberfortheapplication.Thisnumbermustnotmatchwithotherapplications.

The .info file placed in the usr/local/apps/infos directory can be made as part of the software package.

ChangingLauncherbackgroundimage
Theimagefile /etc/settings/wallpaper ispickedupbythelaunchertodisplayasthebackground image.TheimagefilecanbeaJPEG,PNG,BMPorGIFwitharesolutionof240x270pixels.

GeoAmidaSDKDocument

AddinganentryintheSystempanel
TheSystempanelallowstoaddentriesofaparticulartypeinit.Onlytheentriescontainingabutton to launch programs can be added by developers. The entries can be added in the first screen(Commonentries)orthesecondscreen(Advancedentries).Anentrycanbeaddedbycreating afileinthe/usr/local/etc/system_panel/commonor/usr/local/etc/system_panel/advanceddirectory ofGeoAmida.Thefilemusthavea .sysp filenameextensionandcontain3lines,witheachline representingthefollowing:

Line1:Pathtotheexecutableprogram,whichwillbelaunchedwhenthebuttonisclicked. Line2:TexttoappearintheSystempanellist. Line3:Texttoappearonthebutton.

The.syspfileplacedinusr/local/etc/system_panel/commonorusr/local/etc/system_panel/advanced directorycanbemadeaspartofthesoftwarepackage.

Runningprogramsautomaticallyduringstartup
Whenthedeviceboots,theshellscriptsplacedin /etc/startup_programs/ directoryareexecuted. Thedevelopermayincludeashellscriptinthesoftwarepackageinthisdirectory.

PlayingAudiofiles
madplayandbplaycommands areprovidedinGeoAmidaforplayingMP3andWAVfiles respectively.ThesystemfunctioncallcanbeusedinaCprogramtoplayaudiofile. Forexample:system(madplay /usr/local/audios/menu_voice.mp3);

DebuggingApplications
TheSDKprovidesgdbandvalgrindfordebuggingapplications.ValgrindisavailableonlyonPC, whereasgdbisavailableforbothPCandGeoAmida. Thefollowinglinkstotutorials: GDB: http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html Valgrind: http://www.cprogramming.com/debugging/valgrind.html http://cs.ecs.baylor.edu/~donahoo/tools/valgrind/

GeoAmidaSDKDocument

3.GeoAmidaSoftwarePackageManagement
Introduction
InGeoAmidaallthesoftwaresareinstalledintheformofpackages.Apackageisasinglearchive filecontainingallthefilesneededbythesoftware.TheGeoAmidaSDK provides aPCbased softwarepackagecreatorforthedeveloperstocreatesoftwarepackages. Beforeusingthepackagecreator,thedevelopermustcreateadirectorytreestructurewithfiles,on aPCinthesamewayasithastoappearontheGeoAmida. Letusconsideranexampletomakeitmoreclear.Adeveloperneedstoinstallthefollowing3files onthedevice: 1. Filemyprogin/usr/local/apps/proj/directoryofGeoAmida. 2. Fileimage.jpgin/usr/local/apps/proj/images/directoryofGeoAmida. 3. Filedata.dbin/usr/local/apps/proj/db/directoryofGeoAmida. First,he/shehastocreatetheabovedirectoriesinsomeparticularlocationonthePC.Wewill considerthatparticularlocationas/home/developer/proj/packagedirectoryonourPC.Thiswill bereferredasPackagePath.ThedeveloperrunsthefollowingcommandsonthePCtocreate directories:

cd /home/developer/proj/package mkdir -p usr/local/apps/proj/ mkdir -p usr/local/apps/proj/images/ mkdir -p usr/local/apps/proj/db/

Afterthat,he/shecopiesthefilesusingthefollowingcommands:

cp myprog /home/developer/proj/package/usr/local/apps/proj/ cp image.jpg /home/developer/proj/package/usr/local/apps/proj/images/ cp data.db /home/developer/proj/package/usr/local/apps/proj/db/

Now,thePackagePathcontainsthefilesanddirectories,whichhavetoappearinGeoAmidaafter thepackageisinstalled. OncethePackagePathisready,thedeveloperwillhavetousethePackagecreatorapplicationto createthepackagefile.Thecommandsudopackage_creatorhastoberuninaterminal,tostart thepackagecreator.Theapplicationcomesupasshowninthenextpage:

GeoAmidaSDKDocument

10

Thedeveloperhastofillindetailsregardingthepackageintheentryfields.Thefieldsareexplained asbelow: Name:Nameofthepackage.Mustbeasinglewordcontainingalphabets. Version:Versionnumberofthepackage.Itshouldbeoftheformnumber.number_number Dependency: Thepackagethatis beingcreatedmayhavedependencyonotherpackages. The developermayspecifyithere.ThepackageinstallerontheGeoAmidainstallsthispackage,only afterthedependenciesaremet.Dependeciesarementionedasacommaseparatedlistofpackages withversionnumbers.Intheaboveimage,thepackagespecifiesdependancyonpwrap2andmylib, withparticularversionnumbers. Thisfieldisoptionalandmaybekeptempty. Architecture:Architecturemustbearmel. Description:Asinglelinedescriptionofthepackage. Type:ApackagecanbeofthetypeRequired,OptionalandSystem.TheOptionalpackage canbeuninstalledfromtheGeoAmidadevicelateron. Package Path: Path containing the files and directories for installation. In the above example /home/developer/proj/package/isthePackagePath.

GeoAmidaSDKDocument DestinationPath:Pathwherethepackagehastobecreated.

11

OnclickingOKafterthis,thepackagegetscreatedintheDestinationpath.Thepackagefilename willhavethefollowingformat: NameVersionArchitecture.ppp Fortheexamplewehaveconsidered,apackagecalledmyprog1.0_1armel.pppwillbecreated in/tmponthePC. Thedevelopercanthentransferthe.pppfileontotheGeoAmidadeviceandusetheamidainstall commandtoinstall.

Advancedfeatures
Theremaybecaseswhenadevelopermayhavetodosomeoperationbeforeorafterapackageis installedorremoved.ThustheGeoAmidapackagemanagementsystemallowsthedeveloperto includeshellscriptsinapackage,sothattheyareexecutedatthoseparticularinstances. Theshellscriptsmustbeplacedinthevar/pkgs/folder,whichhastobecreatedbythedeveloper inthePackagePath.Theshellscriptfilenamemustbeinthefollowingformat: PackageName.extension PackageName:Thismustbethenameofthepackage. extension:Thefollowing4varietiesofextensionsareallowed:

preinstScriptwiththisextensionwillbeexecutedbeforepackageinstallation. postinstScriptwiththisextensionwillbeexecutedafterpackageinstallation. preremScriptwiththisextensionwillbeexecutedbeforepackageremoval. postremScriptwiththisextensionwillbeexecutedafterpackageremoval.

Forthe myprog packageexampleweconsideredearlier,thedevelopermaywanttoremovesome files before the package installation. So he/she includes the shell script myprog.preinst in the packageasfollows:

cd /home/developer/proj/package #Package Path mkdir var/pkgs cp myprog.preinst var/pkgs

Themyprog.preinsthasthelinerm /usr/local/apps/proj/db/data.db. Afterthisthedevelopercreatesthemyprogpackageagain,usingthePackagecreator. Note:Allthe4shellscriptsarenotrequiredinapackage.Thedevelopermaychoosetoincludeany ofthem.Also,includingtheshellscriptsinapackageisoptional.

GeoAmidaSDKDocument

12

4.ChangesinPwrap2
ThischapterwillbehelpfulforthedeveloperswhohaveworkedearlieronPwrap.Pwrap2hasthe followingfeatures:

Widgetlookandfeelimproved. SupportforIndianlanguagetextdisplay. SupportforIndianlanguagetextinput. APIsaresameasPwrap,sothatmigratingtheoldPwrapprogramtoPwrap2iseasier. Morewidgetsandactivelydeveloped.

SomeoftheAPIsinPwraparenotsupportedinPwrap2.Theyarelistedbelow:
pw_pixmap pw_create_pixmap_from_file(const char *file, ...); void pw_destroy_pixmap(pw_pixmap pixmap); int pw_get_pixmap_width(pw_pixmap pixmap); int pw_get_pixmap_height(pw_pixmap pixmap); void pw_draw_pixmap(pw_pixmap src_pixmap, pw_widget dest_widget, int src_x, int src_y, int width, int height, int dest_x, int dest_y); void pw_set_display_orientation(pw_widget window, unsigned orientation); unsigned pw_get_display_width(pw_widget window); unsigned pw_get_display_height(pw_widget window); unsigned pw_get_display_orientation(pw_widget window);

ThefollowingnewAPIsareaddedinPwrap2:
void pw_set_border_color(pw_widget widget, const char *color); void pw_textbox_clear(pw_widget widget); void pw_fill_circle(pw_widget widget, int x, int y, int radius) int pw_progressbar_getvalue(pw_widget widget) ; pw_unfocus(pw_widget widget) ; pw_draw_text (pw_widget widget, int x, int y, char *text, char *font, char *colour); pw_entry_engtxt_len(pw_widget widget, int length)" pw_entry_engtxt_chars(pw_widget widget, char *allowed_chars)" messagebox_button pw_messagebox_custom(pw_widget parent, messagebox_button type, messagebox_icon icon, const char *title,const char *mesg, ...)"

GeoAmidaSDKDocument

13

5.ChangesinGeoAmidasoftware
ThischapterwillbehelpfulforthedeveloperswhohavealreadyworkedonGeoAmida.

From4.4to6.1
Followingarethechangesin6.1GeoAmidasoftwarereleaseascomparedto4.1:

TheUserInterfacecompletelyimplementedinPwrap2. Newsoftwarepackagemanagement.PackagecreatorforPCtocreatesoftwarepackagesfor GeoAmida.Moreflexibilityfordeveloperswhilecreatingsoftwarepackages. Lancher background image(wallpaper) support added. Date and time displayed in the Launcher. BatterychargeandInterneticonsaddedinthetopbar. Newmultilingualsoftkeyboard. ConfigurableSystemPanel.Addingcustomentriessupported. Supporttoruncustomprogramsduringstartup. SAMsupportaddedinSmartcardlibrary. Librariesupgradedtomatchwithhardwareupgrades.MostoftheAPIskeptunchanged. PleaseseethechapterChangesinSDKversionsformoreinformation.

GeoAmidaSDKDocument

14

6.ChangesinSDKversions
APIchangesfrom4.4to6.1
Modified libanet(anet.h) *API:anet_connect Old:intanet_connect(char*uname,char*passwd,intdev_id,inttimeout); New:intanet_connect(); *API:anet_connect_manual Old:intanet_connect_manual(char*apn,char*dial_number,char*uname,char*passwd, intdev_id,inttimeout); New:intanet_connect_manual(char*apn,char*dial_number,char*uname,char*passwd); *API:anet_signalstrength Old:intanet_signalstrength(intdevice_id); New:intanet_signalstrength(); Notes:EarlierthemodemselectionwasdonethroughanAPI.Accordingtothenewuserinterface, themodemselectionandauthenticationdetailsareenteredbytheuserusingthemobilemanager application.Thiswasdonein4.4release.AstheparameterstotheAPI'sarenolongerrelevant,itis removedfrom6.1SDKreleaseonwards. DeprecatedorRemoved libanet(anet.h) *API:anet_devs *Macrodefinitions:ANET_RELIANCE_HUAWEI,ANET_RELIANCE_ZTE, ANET_TATAINDICOM_QUALCOM,ANET_AIRTEL_HUAWEI,ANET_MICROMAX, ANET_IWOW,ANET_BROADBAND,ANET_RELIANCE_ZTE_BROADBANDand ANET_RELIANCE_BROADBAND_PLUSareremoved. Notes:EarlierthemodemselectionwasdonethroughanAPI.Accordingtothenewuserinterface, themodemselectionandauthenticationdetailsareenteredbytheuserusingthemobilemanager application.Thiswasdonein4.4release.HencethisAPIisdeprecatedandnotsupported. libgps(libgps.h) *APIs:read_gps_data&read_gps_signalstrength Notes:Pleaseusegps_read_datainstead.Theabove2APIsarestillkepttomaintaincompatibility witholderprograms.

GeoAmidaSDKDocument New libsmartcard(smartcard.h) *Macrodefinitions:CONTACT_SAMandnewfunctionreturnvalues. Notes:SupportforSAMmoduleadded. libbiometric(biometric.h) *API:intbio_change_user_security_level(intfd,unsignedlonguser_id,intsecurity_level); *API:intbio_verify_host_image_data_by_scan(intfd,unsignedchar*image_data,intheight, intwidth,intsensor_timeout_period); *API:intbio_enroll_by_non_suprema_image(intfd,unsignedlong*user_id, unsignedchar*image_data,intheight,intwidth); *API:intbio_reverse_verify_multiple_host_template_data_by_scan(intfd, unsignedchar**template_data,int*template_len,intnTemplate,int*matchedIndex, intsensor_timeout_period); *API:intbio_rectify_iso_template(unsignedchar*ISO_templates,int*template_length); Notes:SupporttochangeFARduringverification. libgps(libgps.h) *Macrodefinitions:SUCCESS,ERRORandERROR_BUSY *Structuredefinition:gps_data(Moreentriesadded). *API:intgps_read_data(intfd,structgps_data*tmp,inttime_out); *API:floatgps_find_distance(floatlat1,floatlng1,floatlat2,floatlng2);

15

Notes: APIsrenamedtostartwithgps_.Newfieldsaddedin gps_data structuretogivemore information. autils(autils.h) *Structuredefinition:model_desc *API:intau_get_device_model(char*model,structmodel_desc*ptr); *API:char*au_get_usb_slavemode(char*data); *API:voidau_set_usb_slavemode(char*set_val); *API:voidau_get_sp_passwd(char*data); *API:voidau_set_sp_passwd(char*data);

You might also like