1. KHULNA UNIVERSITY
CSE3200 – Software Development project-II
Name of the project: -Automated Card Recharge AndroidApplication
Project supervisor
MD.Zahidul Islam
Lecture
Amit Kumar Mondal
Lecture
Computer science and engineering discipline
Khulna University, Khulna
Project submitted by
Md. Arifulhaque
070201
AmiyaRanjan Roy
080206
Raj Kumar Sah
080237
Computer science and engineering discipline
Khulna University, Khulna
2. Acknowledgements
First of all we Acknowledge to almighty god for completing this project successfully. Then we
are grateful to our project supervisor whose intelligent direction has made the task easier to
accomplish. A special thanks to the Head of Department of computer science and engineering to
allow us to take several components form the Android set and interfacing lab as also to the
teacher who has assigned us this project.
3. Index
1. Objective
2. What Is Android
3. Linux
4. Advantage
5. The Basic Componentsof Android Application
6.How to Make Connection between Android Set and Pc
7.Making a Simple OCR Android App using Tesseract
8.Automated Card Recharge AndroidApplication
4. Objective
The object of this project is to a develop software that will perform Android and some external
device controlling operation snapshot Android set
5. What is Android?
Android is a Linux-based operating system designed primarily for touch screen mobile devices
such as smartphones and tablet computers. Initially developed by Android. Android was unveiled
in 2007 along with the founding of the Open Handset Alliance: a consortium of hardware,
software, and telecommunication companies devoted to advancing open standards for mobile
devices.The first Android-powered phone was sold in October 2008.
Android is open source and Google releases the code under the License. This open source code
and permissive licensing allows the software to be freely modified and distributed by device
manufacturers, wireless carriers and enthusiast developers. Additionally, Android has a large
community of developers writing applications ("apps") that extend the functionality of devices,
written primarily in a customized version of the Java programming language.
Linux
Android consists of a kernel based on Linux kernel version 2.6 and, from Android 4.0 onwards,
version 3.x, with middleware, libraries and APIs written in C, and application software running
on an application framework which includes Java-compatible libraries based on Apache
Harmony. Android uses the Dalvik virtual machine with just-in-time compilation to run Dalvik
'dex-code' (Dalvik Executable), which is usually translated from Java bytecode.The main
hardware platform for Android is the ARM architecture. There is support for x86 from the
Android x86 project.
Advantage
Android can Run Multiple Apps at the Same Time
Android Keeps Information Visible on Your Home Screen:
Android Has a Better App Market:
Android Gives You Better Notifications:
Android Lets You Choose Your Hardware:
Android Lets You Choose Your Carrier:
Android Lets You Install Custom ROMs:
Android Lets You Change Your Settings Faster:
Android Does Google and Social Integration:
Android Gives You More Options to Fit Your Budget:
6. The basic components of Android Application
Activity
An application may or may not have a User Interface. If it has a user interface, it will have one or
more Activity.
Service
If an application is to have a long life cycle it should be put into a Service. For example a
background data synchronization utility running continuously should be implemented as a
Service.
Broadcast Receiver
Like Services, Broadcast Receivers do not have a User Interface. Of even more importance, the
code running in the one Receive method of a Broadcast Receiver should make no assumptions
about persistence or long-running operations. If the Broadcast Receiver requires more than a
trivial amount of code execution, it is recommended that the code initiate a request to a Service
to complete the requested functionality.
Content Provider
If an application manages data and needs to expose that data to other applications running in the
Android environment, a Content Provider should be implemented.
How to make connection between Android application and pc
1. Connect via USB
Step 1: Check these on your phone settings. (skip if done)
1. Settings -> Application settings ->Unknown sources.
2. Settings -> Application settings -> Development -> USB debugging.
7. Step 2: Install the USB driver for your android Phone on computer
Install the USB driver you got from your android phone Manufacturer. It was always in a cd
given to you when you bought your android phone. If you don't have one, you can go to the
manufacturer's Web site, search and download the correct phone USB driver to install or contact
the manufacturer directly.
Step3: Install and run Very Android SMS Backup on your Phone
Free download and install Very Android SMS Backup on your Android phone (Step by step
guide). Or you can go to the Market (Google Play) on your android to find and install
VeryAndroid SMS Backup. Run the SMS Backup software on your phone and you will see this
screen:
Step 4: Start PC Sync Service
Click the "PC Sync" button. Then input a port info or wifi address and then click "Start" button.
Step 5: Run PC Tool for Very Android SMS Backup on computer..
Install PC Tool for Very Android SMS Backup on computer and then run it. Then click "Menu" -
> "Connection". Now you can check the connecting method (USB). Click "Connect" button to
finish.
Done.
Now you can backup, restore or send messages directly on computer with PC Tool for Very
Android SMS Backup.
8. Making a Simple OCR Android App using Tesseract
Android application to extract the text from the image being captured by the camera of your Android
phone! We’ll be using a fork of Tesseract Android Tools by google’sgithub. They are based on the
Tesseract OCR Engine (mainly maintained by Google) and Leptonica image processing libraries.
Some of the procedure is inevitably manual. As much automated help as possible is provided.
More automated tools may appear in the future, but will require a complex install/build process.
The tools referenced below are all built in the training subdirectory.
Generate Training Images
The first step is to determine the full character set to be used, and prepare a text or word
processor file containing a set of examples. The most important points to bear in mind when
creating a training file are:
Make sure there are a minimum number of samples of each character 4
There should be more samples of the more frequent characters - at least 16.
Don't make the mistake of grouping all the non-letters together. Make the text more
realistic. For example, 1234 4321 4152 6325 This gives the textline finding code a much
better chance of getting sensible baseline metrics for the special characters.
The training data should be grouped by font. Ideally, all samples of a single font should
go in a single tiff file, but this may be multi-page tiff (if you have libtiff or leptonica
installed), so the total training data in a single font may be many pages and many 10s of
thousands of characters, allowing training for large-character-set languages.
9. There is no need to train with multiple sizes. 4 point will do. (An exception to this is very
small text. If you want to recognize text with an x-height smaller than about 15 pixels,
you should either train it specifically or scale your images before trying to recognize
them.)
DO NOT MIX FONTS IN AN IMAGE FILE (In a single .tr file to be precise.) This will
cause features to be dropped at clustering, which leads to recognition errors.
The example boxtiff files on the downloads page will help if you are not sure how to
format your training data.
Next print and scan (or use some electronic rendering method) to create an image of your
training page. Upto training files can be used (of multiple pages). It is best to create a mix of
fonts and styles
NOTE: training from real images is actually quite hard, due to the spacing-out requirements.
This will be improved in a future release. For now it is much easier if you can print/scan your
own training text.
Automated Card Recharge AndroidApplication
The below instructions were written for the Android SDK Tools r12. To compile using r14+,
after ndk-build do rm build.xml, then android update project --path, then ant release (without
modifying build.xml). Running the test cases on new versions of the SDK Tools will require
other modifications.
These instructions assume we have already installed the Android SDK and NDK along with
Eclipse and Subversion on Ubuntu.
Overall, what we need to do is to set up the tesseract-android-tools project as a library project in
Eclipse, and tell your project to refer to the library project. So you’ll need two projects in
Eclipse, whereas for an ordinary app you would have just one.
Step-by-step:
Check out the latest tesseract-android-tools source code using Subversion (don’t use the outdated
code from “Downloads”):
git clone https://code.google.com/p/tesseract-android-tools/
Build the project according to the instructions in the readme file. Make sure that ndk-build
successfully creates the .so object files, and that you get “BUILD SUCCESSFUL” when ant
10. finishes. You may need to make three modifications:
Modification 1. Apparently the kernel.org site is unavailable for the libjpeg download, and it’s
been pointed out elsewhere that using an alternative repository works, so use the following
command instead of the existing git clone command:
git clone git://github.com/android/platform_external_jpeg.git libjpeg
Modification 2. Before running ant, edit the existing build.xml as a workaround for Android bug
#13024. Put the following lines immediately before the ending </project> tag:
<!-- beginning of modification -->
<path id="android.libraries.src"><path refid="project.libraries.src" /></path>
<path id="android.libraries.jars"><path refid="project.libraries.jars" /></path>
<!-- end of modification -->
Modification 3. Do ant compile instead of ant release.
Create an AVD running Android 2.2 or higher, and with an SD card.
Import the tesseract-android-tools project into Eclipse:
File->Import->Existing Projects Into Workspace->Choose tesseract-android-tools->Finish
If we get an error complaining about a compiler level 5.0 compatibility problem, right-click the
project name for tesseract-android-tools and do Properties->Java Compiler->Enable project
specific settings and Uncheck “Use default compliance settings,” then set “Generated .class files
compatibility” to 1.5, and set “Source compatibility” to 1.5. Answer yes if asked to rebuild.
Add tesseract-android-tools as a library project:
Right-click tesseract-android-tools project name->Properties->Android->check “Is Library”.
[Optional] Install the built-in test case package by importing the tesseract-android-tools-test
project:
File->Import->Existing Projects Into Workspace->Choose tesseract-android-tools-test->Finish
[Optional] Start the AVD, wait for it to boot, and install the traineddata file required by the test
cases:
wgethttp://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
gunzip eng.traineddata.gz
adb shell mkdir /mnt/sdcard/tesseract
11. adb shell mkdir /mnt/sdcard/tesseract/tessdata
adb push eng.traineddata /mnt/sdcard/tesseract/tessdata
[Optional] Run the test cases–the test cases should pass, saying “OK (3 tests)”:
adb install tesseract-android-tools-test/bin/tesseract-android-tools-test.apk
adb shell am instrument -w -e package com.googlecode.tesseract.android.test
com.googlecode.tesseract.android.test/android.test.InstrumentationTestRunner
Create your new app as a new Android project.
Configure your project to use the tesseract-android-tools project as a library project: Right click
your new project name, do Properties->Android->Library->Add, and choose tesseract-android-
tools.
You can now create a TessBaseAPI object in your app’s on Create():
File myDir = getExternalFilesDir(Environment.MEDIA_MOUNTED);
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(myDir.toString(), "eng"); // myDir + "/tessdata/eng.traineddata" must be present
baseApi.setImage(myImage);
String recognizedText = baseApi.getUTF8Text(); // Log or otherwise display this string...
baseApi.end();
Run your project on the AVD.
Other basic examples can be found in the TessBaseAPITest.java file in the tesseract-android-
tools-test project.
Recharge:
We use the text, then modify for our recharge option for different operators.