This is an old revision of the document!


Warm-up assignment

Deadline: Thursday, 27 March 2014, 23:55:00 Submit the archived Android projects to the e-mail address: petre.eftime [at] gmail.com

Description

Assignment resources archive: ndk-assignment.zip

Your task is to create a backup service for Android and an Activity or series of Activities which act as a front-end for the service. Archiving and unarchiving should be handled by a native library. The application must be able to read and write data to the phone's internal or external storage.

Service

The service must be accessible implicitly by other applications via the “application.service.NDK_BACKUP” action.

An application should be able to start the service with an intent containing the following fields:

  • “operation” - String, containing either “archive” or “unarchive” depending on the operation
  • “path” - String, path of the folder or file to be archived or the path to the folder where the contents of the archive should be extracted
  • “archive” - String, used only by “unarchive”, the name of the archive to be processed

In case this mode of operation is used, you should add notifications to announce the user when the operation has started and ended.

An application should also be able to use the service via a binder which implements the interface described in IBinderService.aidl found in the assignment archive.

Archives are to be given a default name which includes the current date in IS0 8601 format: e.g bak2014-03-18T21:29:15.zip. If two or more archives would be given the same name, add a number to the file name before the extension for example, the second archive would be: bak2014-03-18T21:29:15-1.zip and the third: bak2014-03-18T21:29:15-2.zip.

Application

The application should have the following functionality through one or multiple Activities:

  • A way to set a folder for where the archives will be stored.
  • A way to create a backup and way to restore a backup. The archive and path must be supplied by the user.
  • A way to explore the file system more easily, to be able to choose archives or paths for the previous tasks.

Library

The service should use a native library for archiving and unarchiving. Make an API to your liking, but the implemented functionality should be as follows:

  • Functions for archiving and unarchiving. The archive can be in any format but it must preserve relative paths and the contents of the files, including empty directories. Permissions and ownership are not important.
  • Functions for getting the file names and paths in an archive.
  • The archive should be compressed (android comes with libzlib by default)
  • It is desirable that the archives are in a standard format (zip, tar, tar.gz, 7zip, etc). You can use external libraries, but the source must be available.

Points

  • 3p Service
    • 1p Implementing onStartCommand functionality
    • 1p Implementing the binder functions
    • 1p Notifications
  • 4p Application
    • 1p Selecting the backup folder
    • 1p Archiving and unarchiving
    • 2p File explorer for selecting locations used in previous two tasks
  • 4p Native library
    • 1p Archiving
    • 1p Unarchiving
    • 1p Compression
    • 1p Using a standard format for the archive (tar, tar.gz, zip, 7zip, etc.)

You lose 0.6 points per day for each day after the dealine, up to a maximum of 7 days.

ndk/assignments/warmup.1395266849.txt.gz · Last modified: 2014/03/20 00:07 by petre.eftime
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0