|
CSE-2041A
Net-Centric Computing
York University
Fall 2011
|
Project
BB PhoneBook App
|
|
|
|
Welcome
to the project.
For the project,
your team will develop a mobile app for the BlackBerry 9000 smart-phone
for an “always-on” phonebook app.
due date
|
9:00pm Wednesday 7 December 2011 (close of lab), but by
9:00pm Friday 9 December 2011 (close of lab)
is fine without penalty
|
teams
|
a minimum of two, and a maximum of three, students per team
|
platform
|
- client side: BlackBerry widget (WebWorks)
- server-side: CGI and JDBC
- IDE: Eclipse (Hellios) with BB plugins
|
The app enables a mobile user to interact
with a phone book stored on an online database server,
and shadowed locally on the BlackBerry smartphone.
|
|
Tuesday 29 November (Lab #8)
-
Familiarize yourself with the project.
-
Do the BB Widget Trial.
-
Do the PIM Widget exercise.
-
Start into the project.
Lab report:
Send an email to
godfrey@cse.yorku.ca
with the subject “CSE2041 Lab #8 Report”.
Say briefly in the email the fix you made for gender
in the SIS app in the BB Widget Trial.
|
|
Tuesday 6 December (Project Lab)
-
For the project.
-
Work on the project
before this too, of course!
|
|
|
|
|
Tthe
app must support of the following use cases:
-
User to look up the phone number of a given name prefix.
-
User to edit or delete an entry returned by the look-up use case.
-
User to insert a new entry.
The app must use the online server whenever available,
and falls back on the local database if there is no connectivity.
|
|
|
|
You
should deliver three things by the due date of this project.
-
The BlackBerry that was assigned to your team,
with the app loaded on it.
-
Submit the project report.
The report file
—
in pdf or doc formats
—
can be submitted using the command:
submit 2041 proj report_file
The report is meant to describe your execution
of the project to someone who is familiar with the project;
e.g. a fellow student who is also executing the same project,
and writing a similar report.
Hence, the report should focus on your own experience and efforts;
i.e., what you actually did, rather than on general description.
It is expected to be very brief, to the point,
and made up of at most two pages (excluding source listings).
The report should
include three sections.
-
overview.
Describes the overall architecture,
design, and implementation issues,
and a self-assessment of any limitation or deficiencies,
-
team.
The cse# and name of each team member,
an explanation of how the work was divided,
and how was communication and consistency maintained,
and the main lessons that were learned from this project,
-
source files.
Listings of all HTML, CSS, JS, Java,
and CGI files that make up the project.
Make sure the code is properly formatted.
-
Submit your project files.
These include the following.
-
widget source files.
HTML, CSS, JS, XML.
In one archive.
-
widget cod file.
Must be signed.
-
server-side files.
CGI, Java.
In one archive.
Use
submit 2041 proj files...
|
|
|
|
The
The project will be evaluated based primarily
(80%) on meeting the specs
—
these include system functionality and report contents
and on its internal quality
—
design, style, code, etc.
The remaining (20%) is based on how your project compares
with those of other teams.
|
|
|
|
It
is recommended that you approach this project in an iterative manner.
-
Create a remote widget,
one that works with the remote database.
This widget uses form submission or AJAX
to enable the user to add, edit, delete, or search.
-
Create a local widget,
one that works with the device's PIM.
This widget has the same interface and functionality as remote,
but it uses the PIM API to access the local database.
-
Merge the two widgets into one.
After all, they have the same user interface,
and differ only in their database connection.
The user can click a radio button on the HTML page
to indicate whether the remote or the local database is to be used.
-
Automate the database selection,
by figuring out how to synchronize the two databases.
|
|
|
|
Test
the procedure for developing,
testing, and installing an app.
|
|
Widget Development
-
Launch Eclipse with the BlackBerry Web Plugin:
click Start, Programs, BlackBerry, EclipseEE BlackBerry.
-
When prompted to enter the workspace, enter:
e.g., Z:\cse2041\workspace
Do not use the default on C: !
-
Create a new BlackBerry Widget Project: click File, New.
If such a project is not listed,
click “Other”
and type in “BlackBerry”
to locate this project type.
-
Call your project SIS ,
and type in first.html
for the start page.
-
Double-click first.html so that it opens
in the editor window.
Delete its default contents by replacing it with the contents
of this document:
-
www.cse.yorku.ca/course/2041/slides/sisStat/two/sis.html
You can simply copy and paste from the source
of the above document to the editor window.
-
Right-click the project name and select
“New Folder”.
If the Folder option is not listed,
then choose
“Other”
and then type
“Folder”
Call the new folder res (for resources).
-
Right-click the res folder and select
“New CSS”.
Call the new CSS myStyle.css .
Double-click myStyle.css to open it
in the editor window,
and replace its contents with the content of this document:
-
www.cse.yorku.ca/course/2041/slides/sisStat/two/res/myStyle.css
-
Right-click the res folder and select
“New JavaScript Source File ”.
Call the new script myScript.js .
Double-click myScript.js ,
and replace its contents with the content of this document:
-
www.cse.yorku.ca/course/2041/slides/sisStat/two/res/myScript.js
-
Right-click the res folder,
and select “New JavaScript Source File”.
Call the new script ajax2041.js .
Double-click ajax2041.js
and replace its contents with the content
of this document:
-
www.cse.yorku.ca/course/2041/slides/sisStat/two/res/ajax2041.js
-
Save all files and right-click the project name and select
“Run As BlackBerry Simulator”.
|
|
Testing
-
Test your app.
-
You will notice that the simulator refuses to connect to the URL on
the server end.
Fix this problem by granting permission to the URL's
domain and all its sub-domains.
In addition,
fill some of the fields in the config.xml file,
so that you can see how they appear on the device.
-
Test your app again.
It should connect properly now.
-
There is a bug in the app related to gender.
Test this by changing the gender and observing the response.
Fix the gender problem and re-test your app.
|
|
App Signing
-
Visit the URL:
-
https://webapp.cse.yorku.ca/bbsign
-
Upload the cod and csl files
in your workspace.
Navigate to:
Z:\cse2041\workspace\SIS\build\StandardInstall
Z:\cse2041\workspace\SIS\build\OTAInstall\
to grab the cod file.
Use the csl from
Z:\cse2041\workspace\SIS\build\StandardInstall
-
After the widget is signed,
download its signed cod file,
and save it in the same location.
You can over-write the unsigned file,
or name it differently.
|
|
App Loading
-
Connect your BB phone to a USB port to charge it.
-
Make a Web accessible directory
under your www/
directory in your home directory.
Call it, say, sisApp/ .
Copy the .cod file and the .jad
files from build/OTAInstall/
in the directory from your project (under Eclipse)
to www/sisApp/ .
-
Set up the BB to use AirYork WIFI.
(Authenticate for AirYork.)
Check the BB can reach the Web
by browsing a site or two.
-
Start the BB's web browser and go to the URL
of your www/sisApp/ .
Click on the .jad file.
The BB will download the app and install!
You will find it in BB's download directory.
|
|
|
|
Create
a new BlackBerry Widget Project in which
you can explore accessing local features.
Its main HTML page should have buttons that trigger
the JavaScript explorations shown here.
|
|
Permissions
This
widget uses the Widget API to access the
“Personal Information Manager”,
PIM, onboard the BlackBerry smartphone.
As such,
make sure you add a feature permission
in the widget's config.xml
for every backberry.pim.object
that you use.
|
|
Sample Code
To
create an address object:
var myAddress = new blackberry.pim.Address();
myAddress.address1 = "2020 CSEB";
myAddress.address2 = "4700 Keele Street";
myAddress.city = "Toronto";
myAddress.country = "Canada";
myAddress.stateProvince = "Ontario";
myAddress.zipPostal = "M3J 1P3";
To create a contact object:
var contact = new blackberry.pim.Contact();
contact.firstName = "Net-Centric";
contact.lastName = "Computing";
contact.workAddress = myAddress;
contact.save();
After you run this fragment,
go to the built-in “Contacts App”
and verify that an entry has been added.
To search and/or iterate over the PIM database:
Use the blackberry.find.FilterExpression object.
Note that every entry in PM has a unique uid.
The
Blackberry Widget API
has several examples on using find .
|
|
|
|
|