Академический Документы
Профессиональный Документы
Культура Документы
The main aim of this Practice School program at Creative Xperts Consulting Pvt Ltd.,
Hyderabad is to create Android applications on StoreOngo Platform, get habituated to the
platform and Optimizing the original StoreOngo Platform with the technical knowledge I
have acquired through the duration of the Practice School Program. Apart from the main aim,
the technical knowledge which I acquired here should help me in my Thesis and organization
exposure I acquired here should give me an idea about work culture in my future
employment. My Practice School Program Work deals primarily with designing and
developing Mobile applications using STOREONGO platform developed by CREATIVE
XPERTS. It is a user friendly platform for developing mobile apps with minimal technical
knowledge for the end user. After getting ourself habituated to the platform, Company Guide
has asked to perform modifications to the platform on the Android side. Each team members
were given a particular set of tasks which will optimize the Android platform. These tasks
were purely technical and during these processes Ive got exposure to the real world
application development using the technologies that are being employed in the organization.
Apart from the technical aspects, there came a chance to study the work style and
organizational flow of a firm, which would enhance my employability skills. This Practice
School program work we ve done here, apart from helping the organization, had also helped
us to observe and study the actual work flows and technical aspects incorporated into the
organizations internal platform.
StoreOnGo is a platform developed by Creative Xperts
Consulting Pvt Ltd.
StoreOngo is a platform for development of android mobile applications in the business
sector. By using this platform a client or user or developer can easily develop an android
mobile application based on their business requirements in five simple steps. The application
gives the business user to provide the consumers with a vast choice of services. These help
the consumers to reach and contact the business with ease and stay in touch with business
user. This establishes a communication channel between the user and the business. Business
users aim to maximize business from the consumers. To that end, application provides the
business user with a wide variety of marketing tools that help attract more business.
CHAPTER-1
INTRODUCTION
Introduction
1.1 Overview of the Company
1.2 Analysis
Analytics play a major role in marketing of a business. Analytics help the business users to
easily analyse and estimate the buying patterns of a consumer. The business user gets a wide
variety of analytics with the application suite. They are majorly classified as follows:
Business user can use these analytics to identify the gaps in the order management flow and
make the changes that are necessary.
Application based analytics are very important for a business user as they can have an idea of
the consumer base that is currently using the apps.
Application based analytics give the following parameters:
Parameters that are provided in the campaign analytics are listed below:
Features
Native Apps
Provides fast performance and a high degree of reliability
Business pages
Business Information
Provide info like Contact details, open hours and social presence of the business
Products / Merchandise
Coupons, Offers
Services
Photos, Videos
Upload photos and videos about the business, products, offers, etc.
Reviews
Business Pages
My Account
Apps that work both online and offline for easy access of data anywhere-anytime
Reach & Retain consumers with the help of loyalty program. Manage loyalty through the APP
Lead Management
Manage leads generated from the app and convert leads into loyal consumers
Push Notifications
Keep the Consumer updated about latest offers, products, etc., by pushing notifications on
their mobile
Manage Reviews
View the reviews posted by the users and display only the relevant reviews
Campaign Management
Security
CHAPTER-2
SERVICES OF THE COMPANY
Basic/Simple services
Special services
Services with workflow
Services groups/groups of services
The business user has to detect whether a service is simple or special while adding a service
Services with workflow gives the business user the ability to change and update the status of
the service request sent by the consumer. Business user can also display the status of the
service request to the consumer and let them know the current position of that particular
request.
Services with workflow allow the business user to do the following activities:
Add new service type with the desired group name for that service
Add another new service that falls under a group
There will be a list of all the group names in a drop down menu
Choose the desired group name under which the service should be added to a service
group will be created with all the child services under it.
A service group will be created with all the child services under it.
CHAPTER-3
IMPLEMENTATION METHEDOLOGY
Implementation Methodology
3.1 Platform and Software Tools used:
Platform:
Storeongo
IDE:
Eclipse IDE/ Android Studio
Tools:
Android Asset Studio/Icon Generator
Color Picker
Architecture Pattern:
MVC : Model-View-Control
Technologies:
Java
DataBases:
CHAPTER-4
ARCHITECTURE PATTERN USED: MVC ARCHITECTURE
The model
The model is responsible for managing the data of the application. It responds to the
request from the view and it also responds to instructions from the controller to update
itself.
The view
A presentation of data in a particular format, triggered by a controller's decision to
present the data. They are script based templating systems like JSP, ASP, PHP and
very easy to integrate with AJAX technology.
The controller
The controller is responsible for responding to user input and performs interactions on
the data model objects. The controller receives the input, it validates the input and
then performs the business operation that modifies the state of the data model.
CHAPTER-5
USE CASE DIAGRAMS
Fig. 3 Use Case Diagram: Creating an application and initialising the Activation Notification.
Primary Actor
BUSINESS USER
Secondary Actor :
ADMIN/DEVELOPER
Scope
Level
Brief
Business User creates his app using the FIVE STEPS and activation
notification will be sent. Based on the permissions. It will be activated by the admin or the
user itself.
Primary Actor
Secondary Actor :
BUSINESS USER
ADMIN/DEVELOPER
Scope
Data insertions and modifications by the Business user for his created app.
Level
Brief
: Here business user enters the data required after the app is activated. Admin
plays a supporting role here, If there are any problems for Business User, he will be dealing
with them.
Primary Actor
Secondary Actor :
BUSINESS USER
Tertiary Actor
: ADMIN/DEVELOPER
Scope
: End user installs the app created by Business user and starts using the
app services. Whenever there is a new update, Business user broadcasts it to the registered
Consumers.
Level
: 3
Brief
wants to interact with users, he broadcasts the notifications to the registered users. Admin will
be playing supporting role here, If Business user needs any tech support or the app has a new
update etc.
KL University, Department of Computer Science and
Engineering 22|page
CHAPTER-6
CLASS DIAGRAMS
Class Diagrams
Class diagrams for the above use case diagrams, which are self-explanatory are given below
as follows:
CHAPTER-7
TECHNOLOGIES EMPLOYED
Technologies Employed
Any entity that has state and behaviour is known as an object. For example: chair, pen, table,
keyboard, bike etc. It can be physical and logical.
7.2.2 Class
Collection of objects is called class. It is a logical entity.
7.2.3 Encapsulation
Encapsulation in java is a process of wrapping code and data together into a single unit, for
example capsule i.e. mixed of several medicines. We can create a fully encapsulated class in
java by making all the data members of the class private. Now we can use setter and getter
methods to set and get the data in it.
Fig.10 Encapsulation
The Java Bean class is the example of fully encapsulated class.
7.2.4 Inheritance
KL University, Department of Computer Science and
Engineering 29|page
Inheritance in java is a mechanism in which one object acquires all the properties and
behaviours of parent object. The idea behind inheritance in java is that you can create new
classes that are built upon existing classes. When you inherit from an existing class, you can
reuse methods and fields of parent class, and you can add new methods and fields also.
Inheritance represents the IS-A relationship, also known as parent-child relationship.
Types of Inheritance
7.2.5 Polymorphism
If an entity can be represented in more than one form, that entity is said to exhibit
polymorphism.
If an entity can be represented in more than one form, that entity is said to exhibit
polymorphism.
1) Operator overloading is compile time polymorphism. For example, + operator can be used
to add two numbers OR to concatenate two strings. It's an example of polymorphism strictly
saying compile-time polymorphism.
2) Method overloading is compile time polymorphism. For example, a method with same
name can have more than one implementations. It's also a compile-time polymorphism. It's
compile-time because before execution of program compiler decides the flow of program i.e
which forms will be used during run-time.
3) Method overriding is run-time polymorphism.
7.2.6 Abstraction
Abstraction is a process of hiding the implementation details and showing only functionality
to the user.
Another way, it shows only important things to the user and hides the internal details for
example sending sms, you just type the text and send the message. You don't know the
internal processing about the message delivery.
Abstraction lets you focus on what the object does instead of how it does it.
Fig. 14 Abstraction
Abstract Class
A class that is declared as abstract is known as abstract class. It needs to be extended and its
method implemented. It cannot be instantiated.
Abstract method
A method that is declared as abstract and does not have implementation is known as abstract
method.
7.2.7 Interface
An interface in java is a blueprint of a class. It has static constants and abstract methods only.
The interface in java is a mechanism to achieve fully abstraction. There can be only
abstract methods in the java interface not method body. It is used to achieve fully abstraction
and multiple inheritances in Java.
Java Interface also represents IS-A relationship.
It cannot be instantiated just like abstract class.
There are mainly three reasons to use interface. They are given below.
It is used to achieve fully abstraction.
By interface, we can support the functionality of multiple inheritance.
It can be used to achieve loose coupling.
Abstract class and interface both are used to achieve abstraction where we can declare the
abstract methods. Abstract class and interface both can't be instantiated.
7.3 MySQL:
Table: A table is a matrix with data. A table in a database looks like a simple
spreadsheet.
Column: One column (data element) contains data of one and the same kind, for
example the column postcode.
Row: A row (= tuple, entry or record) is a group of related data, for example the data
of one subscription.
Primary Key: A primary key is unique. A key value cannot occur twice in one table.
With a key, you can find at most one row.
KL University, Department of Computer Science and
Engineering 34|page
Foreign Key: A foreign key is the linking pin between two tables.
Compound Key: A compound key (composite key) is a key that consists of multiple
columns, because one column is not sufficiently unique.
Referential Integrity: Referential Integrity makes sure that a foreign key value
always points to an existing row.
MySQL is released under an open-source license. So you have nothing to pay to use
it.
MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.
MySQL works on many operating systems and with many languages including PHP,
PERL, C, C++, JAVA, etc.
MySQL works very quickly and works well even with large data sets.
MySQL is very friendly to PHP, the most appreciated language for web development.
7.4 SQLite:
SQLite-ANDROID Database
Android comes in with built in SQLite database implementation. SQLite supports all the
relational database features. In order to access this database, you don't need to establish any
kind of connections for it like JDBC, ODBC etc.
Database - Package
The main package is android. database. sqlite that contains the classes to manage your own
databases
KL University, Department of Computer Science and
Engineering 36|page
Database - Creation
In order to create a database you just need to call this method open Or Create Database with
your database name and mode as a parameter. It returns an instance of SQLite database which
you have to receive in your own object. Its syntax is given below
SQLiteDatabse mydatabase = openOrCreateDatabase("your database name",MODE_PRIVATE,null);
Apart from this , there are other functions available in the database package , that does this
job. They are listed below
Sr. No
1.
2.
3.
4.
openOrCreateDatabase(File
factory)
file,
SQLiteDatabase.CursorFactory
This method is similar to above method but it takes the File object as a
path rather then a string. It is equivalent to file.getPath()
Table 1 Database Creation
Database - Insertion
we can create table or insert data into table using execSQL method defined in
SQLiteDatabase class. Its syntax is given below
mydatabase.execSQL("CREATE TABLE IF NOT EXISTS TutorialsPoint(Username VARCHAR, Password
VARCHAR);"); mydatabase.execSQL("INSERT INTO TutorialsPoint VALUES('admin','admin');");
This will insert some values into our table in our database. Another method that also does the
same job but take some additional parameter is given below
Sr.No
Database - Fetching
We can retrieve anything from database using an object of the Cursor class. We will call a
method of this class called rawQuery and it will return a resultset with the cursor pointing to
the table. We can move the cursor forward and retrieve the data.
Cursor resultSet = mydatbase.rawQuery("Select * from TutorialsPoint",null);
resultSet.moveToFirst();
String username = resultSet.getString(1);
String password = resultSet.getString(2);
There are other functions available in the Cursor class that allows us to effectively retrieve
the data. That includes
Sr. No
1.
2.
getColumnIndex(String columnName)
This method returns the index number of a column by specifying the name
of the column
3.
getColumnName(int columnIndex)
This method returns the name of the column by specifying the index of the
column
4.
getColumnNames()
This method returns the array of all the column names of the table.
5.
getCount()
This method returns the total number of rows in the cursor
6.
getPosition()
This method returns the current position of the cursor in the table
7.
isClosed()
This method returns true if the cursor is closed and return false otherwise
Table 2 Database Fetching
Steps
Description
1.
You will use Android studio to create an Android application under a package
com.example.xyz.myapplication. While creating this project, make sure you
Target SDK and Compile With at the latest version of Android SDK to use higher
levels of APIs.
2.
3.
4.
Create a new Activity as DisplayContact.java that will display the entity on the
screen
5.
6.
7.
8.
9.
10.
Run the application, choose a running android device and install the application
on it.
7.5 JAVASCRIPT
7.6 HTML
KL University, Department of Computer Science and
Engineering 41|page
7.7 JSON
JSON, (JavaScript Object Notation), is an open standard format that uses human-readable
text to transmit data objects consisting of attributevalue pairs. It is the primary data format
used for asynchronous browser/server communication (AJAJ), largely replacing XML (used
by AJAX).
Although originally derived from the JavaScript scripting language, JSON is a languageindependent data format. Code for parsing and generating JSON data is readily available in
many programming languages.
The JSON format was originally specified by Douglas Crockford. It is currently described by
two competing standards, RFC 7159and ECMA-404. The ECMA standard is minimal,
describing only the allowed grammar syntax, whereas the RFC also provides some semantic
and security considerations. The official Internet media type for JSON is application/json.
The JSON filename extension is json.
7.8 XML
Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format which is both human-readable and machine-readable. It is
defined by the W3C's XML 1.0 Specification and by several other related specifications, all
of which are free open standards.
The design goals of XML emphasize simplicity, generality and usability across the Internet. It
is a textual data format with strong support via Unicode for different human languages.
Although the design of XML focuses on documents, it is widely used for the representation
of arbitrary data structures such as those used in web services
7.9 Android :
Android is an open source and Linux-based operating system for mobile devices such as
smartphones and tablet computers. Android was developed by the Open Handset Alliance, led
by Google, and other companies.
What is Android?
Android is an open source and Linux-based Operating System for mobile devices such as
smartphones and tablet computers. Android was developed by the Open Handset Alliance, led
by Google, and other companies.
Android offers a unified approach to application development for mobile devices which
means developers need only develop for Android, and their applications should be able to run
on different devices powered by Android.
The first beta version of the Android Software Development Kit (SDK) was released by
Google in 2007 where as the first commercial version, Android 1.0, was released in
September 2008.
On June 27, 2012, at the Google I/O conference, Google announced the next Android version,
4.1 Jelly Bean. Jelly Bean is an incremental update, with the primary aim of improving the
user interface, both in terms of functionality and performance.
The source code for Android is available under free and open source software licenses.
Google publishes most of the code under the Apache License version 2.0 and the rest, Linux
kernel changes, under the GNU General Public License version 2.
Description
Beautiful UI
Connectivity
Storage
Media support
Messaging
Web browser
Multi-touch
Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero.
Multi-tasking
User can jump from one task to another and same time various
application can run simultaneously.
Resizable
widgets
Widgets are resizable, so users can expand them to show more content
or shrink them to save space
Multi-Language
GCM
Wi-Fi Direct
A technology that lets apps discover and pair directly, over a highbandwidth peer-to-peer connection.
Android Beam
API
Level
VERSION_CODE
Android 5.1
22
LOLLIPOP_MR1
Android 5.0
21
LOLLIPOP
Android 4.4W
20
KITKAT_WATCH
Android 4.4
19
KITKAT
Android 4.3
18
JELLY_BEAN_MR2
17
JELLY_BEAN_MR1
16
JELLY_BEAN
15
ICE_CREAM_SANDWICH_MR1
14
ICE_CREAM_SANDWICH
Android 3.2
13
HONEYCOMB_MR2
Android 3.1.x
12
HONEYCOMB_MR1
Android 3.0.x
11
HONEYCOMB
10
GINGERBREAD_MR1
GINGERBREAD
Android 2.2.x
FROYO
Android 2.1.x
ECLAIR_MR1
Android 2.0.1
ECLAIR_0_1
Android 2.0
CLAIR
Android 1.6
DONUT
Android 1.5
CUPCAKE
Android 1.1
BASE_1_1
Android 2.3.4
Android 2.3.3
Android 2.3.2
Android Studio
Eclipse IDE
Description
android:id
android:layout_width
android:layout_height
android:layout_marginTop
android:layout_marginBottom
android:layout_marginLeft
android:layout_marginRight
android:layout_gravity
android:layout_weight
This specifies how much of the extra space in the layout should
be allocated to the View.
android:layout_x
android:layout_y
android:layout_width
android:layout_width
android:paddingLeft
android:paddingRight
android:paddingTop
android:paddingBottom
TextView
This control is used to display text to the user.
EditText
EditText is a predefined subclass of TextView that includes rich editing capabilities.
AutoCompleteTextView
The AutoCompleteTextView is a view that is similar to EditText, except that it shows a list of
completion suggestions automatically while the user is typing.
Button
A push-button that can be pressed, or clicked, by the user to perform an action.
ImageButton
AbsoluteLayout enables you to specify the exact location of its children.
CheckBox
An on/off switch that can be toggled by the user. You should use check box when presenting
users with a group of selectable options that are not mutually exclusive.
ToggleButton
RadioButton
The RadioButton has two states: either checked or unchecked.
RadioGroup
A RadioGroup is used to group together one or more RadioButtons.
10
ProgressBar
The ProgressBar view provides visual feedback about some ongoing tasks, such as when you
are performing a task in the background.
11
Spinner
A drop-down list that allows users to select one value from a set.
12
TimePicker
The TimePicker view enables users to select a time of the day, in either 24-hour mode or
AM/PM mode.
13
DatePicker
The DatePicker view enables users to select a date of the day.
Hibernate:
Hibernate ORM (Hibernate in short) is an object-relational mapping framework for the Java
language, providing a framework for mapping an object-oriented domain model to a
traditional relational database. Hibernate solves object-relational impedance mismatch
problems by replacing direct persistence-related database accesses with high-level object
handling functions.
Hibernate is free software that is distributed under the GNU Lesser General Public License
2.1.
Hibernates primary feature is mapping from Java classes to database tables (and from Java
data types to SQL data types). Hibernate also provides data query and retrieval facilities. It
generates SQL calls and relieves the developer from manual result set handling and object
conversion. Applications using Hibernate are portable to supported SQL databases with little
performance overhead.
7.10.1 Mapping:
Mapping Java classes to database tables is accomplished through the configuration of an
XML file or by using Java Annotations. When using an XML file, Hibernate can generate
skeleton source code for the persistence classes. This is unnecessary when annotations are
used. Hibernate can use the XML file or the annotations to maintain the database schema.
Facilities to arrange one-to-many and many-to-many relationships between classes are
provided. In addition to managing associations between objects, Hibernate can also manage
KL University, Department of Computer Science and
Engineering 55|page
reflexive associations where an object has a one-to-many relationship with other instances of
its own type. Hibernate supports the mapping of custom value types. This makes the
following scenarios possible: Overriding the default SQL type that Hibernate chooses when
mapping a column to a property.
Definition: Objects in a front-end application follow OOP principles, while objects in the
back-end follow database normalization principles, resulting in different representation
requirements. This problem is called "object-relational impedance mismatch". Mapping is a
way of resolving the impedance mismatch problem. Mapping tells the ORM tool which java
class object to store in which database table
7.10.2 Architecture:
Layer, backhand API layer and database layer. Let's see the diagram of hibernate architecture
There are 4 layers in hibernate architecture java application layer, hibernate framework
Session Factory
The Session Factory is a factory of session and client of Connection Provider. It holds second
level cache (optional) of data. The org.hibernate.SessionFactory interface provides factory
method to get the object of Session
Session
The session object provides an interface between the application and data stored in the
database. It is a short-lived object and wraps the JDBC connection. It is factory of
Transaction, Query and Criteria. It holds a first-level cache (mandatory) of data. The
org.hibernate.Session interface provides methods to insert, update and delete the object. It
also provides factory methods for Transaction, Query and Criteria.
Transaction
The transaction object specifies the atomic unit of work. It is optional. The
org.hibernate.Transaction interface provides methods for transaction management.
TransactionFactory
It is a factory of Transaction. It is optional.
JPA:
The Java Persistence API (JPA) is a Java application programming interface specification
KL University, Department of Computer Science and
Engineering 57|page
That describes the management of relational data in applications using Java Platform,
Standard Edition and Java Platform, Enterprise Edition.
CHAPTER-8
TASKS ACHEIVED
Tasks Achieved
(Mobile Applications and Fixing Bugs in the Platform)
Has designed and developed over 52+ Applications on STOREONGO PLATFORM.All of
these developed apps were in the CREATIVE XPERTS, internal Server on STOREONGO.
Created APK files for those apps and made them ready to be deployed to the PLAYSTORE.
Apart from these Mobile App generation, has modified/fixed some issues in the internal
platform itself from On Job Training given by the Company.we have worked on four issues
in the platform.
They are as follows:
Database tables and columns creation using sqlite(db) in android - Modification done
on OngoDaoImpl, OngoDBHandler:Change reflected at DATABASE
Getting data from server as JSON format and store in SQLite(db) : Modification done on
GetAsyncTask-OngoDaoImpl,
New design for custom blocks -- > Modification done on Infofragment and
KeySlideActivity:Change reflected on UI
done on
HomeActivity and ProdFragments:Change reflected at both DATABASE&UI
Sample Code:
For APK Generation:
android:protectionLevel="signature" />
<!-- PERMC2D_MESSAGE -->
<permission android:name="
com.ongo.omgspaandsalon.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<!-- UPERMC2D_MESSAGE -->
<uses-permission android:name="
com.ongo.omgspaandsalon.permission.C2D_MESSAGE" />
<uses-permission
android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- UPERM_MAPS_RECEIVE -->
<uses-permission android:name="
com.ongo.omgspaandsalon.permission.MAPS_RECEIVE" />
<uses-permission
android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
RESOURCESVALUESSTRINGS
<string name="mallname">Aaaj Marketing</string> <string
name="mall_id">3945</string> <string name="sharePattern">.app/3945/..*</string>
<!-- if all Malls true change promote pattern as ".m/..*" or else ".m/mallId..*"/ -->
<string name="promotePattern">.m/3945..*</string> <string
name="server_api_url">http://storeongo.com:8081</string> <string
name="shareURL">storeongo.com</string> <string name="ad_id">ca-app-pub2961740639249418/6413995088</string> <string
name="gcm_server_api_url">http://storeongo.com:9000/api</string> <!-http://storeongo.com:8084/mId=3/wId=Products/type=White/iId=312;313 --> <!-http://storeongo.com:8084/mId=3/wId=Products/type=White/iId=312 -->
<!-- ******************************* --> <!-- true or false --> <string
name="dateInKeys">false</string> <string name="basedOnStore">false</string>
<string name="default_image_in_products">false</string> <!-- if all Malls true
change promote pattern as ".m/..*" or else ".m/mallId..*"/ --> <string
name="allMallsApp">false</string> <!-- ******************************* -->
RESOURCESVALUESCOLORS
{
"id": 23907,
"ItemCode": "abd61ac0-f0a9-4e6a-9255-8e0b29566c36",
"createdOn": "12:48 Jun 26, 2015", "createdById": 3945, "jobTypeId": 7955,
"jobTypeName": "Stores", "createdByFullName": "Aaaj Marketing",
"publicURL": "http://storeongo.com/app/3945/Stores;Stores;23907;_;SingleProduct",
"Category_Mall": " Real Estate Agents", "PackageName": "", "Name": "Aaaj Marketing in Real
State Agents", "Image": "", "Address": "Aaaj mrktng
Mr. Amit J Chhabria AAAJ Marketing Consultants P Ltd. 19 nanjappa road shanthi nagar
bangalore india 560027 Bangalore KA India, "Description": "We are currently marketing the
following projects
"District": "",
"PostalCode": "",
"Borough": "",
"Type": "",
"Country": "",
"Zoom": "",
"hrsOfOperation":
"Attachments": [],
"Additional_Details": {},
"jobComments": [],
"Current_Job_Status": "Active",
"Current_Job_StatusId": 19597,
"Next_Seq_Nos": "2",
"CreatedSubJobs": [],
"Next_Job_Statuses": [],
"Insights": [],
"overallRating": "0.0",
"totalReviews": "0",
"offersCount": "-1",
"productsCount": "-1",
"businessType": [],
"guestUserId": "16",
"guestUserEmail": "jagdishcm@gmail.com"},
{
"id": 23902,
KL University, Department of Computer Science and
Engineering 64|page
"ItemCode": "0a927a4f-0b00-411b-b84c-a77a218e5876",
"createdOn": "12:46 march 10, 2016",
"createdById": 3945,
"jobTypeId": 7955,
"jobTypeName": "Stores",
"createdByFullName": "Aaaj Marketing",
"publicURL": "http://storeongo.com/app/3945/Stores;Stores;23902;_;SingleProduct",
"Category_Mall": "Real Estate Agents", "PackageName": "",
"Name": "Aaaj Marketing",
"Image": "", "Address": "Aaaj mrktng Mr. Amit J Chhabria AAAJ Marketing
Consultants P Ltd. 19 nanjappa road shanthi nagar bangalore india 560027
Bangalore",
"Description": "Aaaj Marketing in Real Estate Agents ",
"Street": "",
"State": "",
"Longitude": "78.348917",
"Latitude": "17.440080",
"City": "Hyderabad",
"Contact Number": "+91 9880566886",
"FaceBook": "",
"Twitter": "",
"District": "",
"PostalCode": "",
"Borough": "",
"Type": "",
"Country": "",
"Zoom": "",
"hrsOfOperation": [],
"Attachments": [],
"Additional_Details": {},
"jobComments": [],
"Current_Job_Status": "Active",
"Current_Job_StatusId": 19597,
"Next_Seq_Nos": "2", "CreatedSubJobs": [],
"Next_Job_Statuses": [
{
KL University, Department of Computer Science and
Engineering 65|page
"Status_Id": "19598",
"SeqNo": "2",
"Status_Name": "Inactive",
"Sub_Jobtype_Forms": []
}
],
"Insights": [],
"overallRating": "0.0",
"totalReviews": "0",
"offersCount": "-1",
"productsCount": "-1",
"businessType": [],
"guestUserId": "16",
"guestUserEmail": guest@storeongo.com
},
],
"totalNumRecords": 9,
"count": 9,
"showFields": false,
"showInsights": false,
"showStatuses": false,
"showJTJobs": false,
"averageRating": 0,
"guestUserId": "16",
"guestUserEmail": guest@storeongo.com
}
KL University, Department of Computer Science and
Engineering 66|page
CHAPTER-9
TASKS PERFORMED
Tasks Performed
1. Database tables and columns creation using sqlite(db) in android:
For implementing the above task, we developed and modified two database classes,
OngoDaoImpl, OngoDBHandler, where one is used to IMPLEMENT DATABASE and the
other is used for DATABASE HANDLING. Code for DBHANDLER. These tasks are for
setting up databases so the changes will be implemented in the back end database. Sample
codes for ONGO DB HANDLER and ONGO DB IMPLEMENTATION were given below.
DATABASE HANDLER
package com.cx.ongo.db;
import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
this.database = database;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getLogTag() {
return logTag;
}
public void setLogTag(String logTag) {
this.logTag = logTag;
}
public SQLiteDatabase getReadDB(){
return dbGen.open();
}
public SQLiteDatabase getWriteDB(){
return dbGen.open();
}
public void close(){
try
{
dbGen.close();
}
catch(SQLException sqlEx){
Log.e(logTag, "Exception while closing connection",sqlEx);
}
}
public abstract void onCreate(SQLiteDatabase db);
public abstract void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion);
}
ONGO DB IMPLEMENTATION(Sample) :
package com.cx.ongo.db;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
importandroid.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
public class OnGoDaoImpl implements OnGoDao {
private SQLiteDatabase myDB;
private OnGoDBHandler dbHandler;
public String TAG = "OnGoDaoImpl";
public Gson gson; private Type hashMapType;
Context mContext;
public OnGoDaoImpl(Context context) {
dbHandler = new OnGoDBHandler(context);
gson = new Gson();
myDB = dbHandler.getWriteDB();
mContext = context;
hashMapType = new TypeToken<HashMap<String, Object>>() {
}.getType();
}
public void beginTransaction() { myDB.beginTransaction();
}
public void setTransactionSuccessful() {
myDB.setTransactionSuccessful();
} public void endTransaction() {
myDB.endTransaction();
}
ONGO DB HANDLER(Sample) :
// common
fields public static final String ID = "id";
public static final String ITEM_CODE = "ItemCode";
public static final String CREATED_BY_ID = "createdById";
public static final String CREATED_BY_FULL_NAME = "createdByFullName";
public static final String NAME = "Name";
public static final String DESCRIPTION = "Description";
KL University, Department of Computer Science and
Engineering 71|page
}
}
android:text="@string/Login"
/>
In the java file, inside the method of onClick get the username and passwords text using
getText() and toString() method and match it with the text using equals() function.
EditText username = (EditText)findViewById(R.id.editText1);
EditText password = (EditText)findViewById(R.id.editText2);
public void login(View view){
if(username.getText().toString().equals("admin")&&
password.getText().toString().equals("admin")){
//correcct password
}else{
//wrong password
}
To provide a security mechanism, so that unwanted attempts should be avoided. For this
initialize a variable and on each false attempt, decrement it. And when it reaches to 0, disable
the login button.
int counter = 3;
counter--;
if(counter==0){
//disble the button, close the application etc.
}
Description
You will use Android studio to create an Android application under a package
com.example.sairamkrishna.myapplication. While creating this project, make sure
you Target SDK and Compile With at the latest version of Android SDK to use
KL University, Department of Computer Science and
Engineering 74|page
Run the application and choose a running android device and install the application
on it and verify the results
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
KL University, Department of Computer Science and
Engineering 77|page
import android.widget.TextView;
import android.widget.Toast;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class MainActivity extends Activity {
Button b1,b2;
EditText ed1,ed2;
TextView tx1;
int counter = 3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1=(Button)findViewById(R.id.button);
ed1=(EditText)findViewById(R.id.editText);
ed2=(EditText)findViewById(R.id.editText2);
b2=(Button)findViewById(R.id.button2);
tx1=(TextView)findViewById(R.id.textView3);
tx1.setVisibility(View.GONE);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(ed1.getText().toString().equals("admin") &&
ed2.getText().toString().equals("admin")) {
Toast.makeText(getApplicationContext(),
"Redirecting...",Toast.LENGTH_SHORT).show();
}
KL University, Department of Computer Science and
Engineering 78|page
else{
Toast.makeText(getApplicationContext(),"Wrong
Credentials",Toast.LENGTH_SHORT).show();
tx1.setVisibility(View.VISIBLE);
tx1.setBackgroundColor(Color.RED);
counter--;
tx1.setText(Integer.toString(counter));
if (counter == 0) {
b1.setEnabled(false);
}
}
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
KL University, Department of Computer Science and
Engineering 79|page
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
2. res/layout/activity_main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aaaj Marketing"
android:id="@+id/textView"
android:layout_below="@+id/textview"
android:layout_centerHorizontal="true"
android:textColor="#ff7aff24"
android:textSize="35dp" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:hint="Enter Name"
android:focusable="true"
android:textColorHighlight="#ff7eff15"
android:textColorHint="#ffff25e6"
android:layout_marginTop="46dp"
android:layout_below="@+id/imageView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
KL University, Department of Computer Science and
Engineering 81|page
android:src="@drawable/abc"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/editText2"
android:layout_below="@+id/editText"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="@+id/editText"
android:layout_alignEnd="@+id/editText"
android:textColorHint="#ffff299f"
android:hint="Password" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Attempts Left:"
android:id="@+id/textView2"
android:layout_below="@+id/editText2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="25dp" />
<TextView
KL University, Department of Computer Science and
Engineering 82|page
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/textView3"
android:layout_alignTop="@+id/textView2"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignBottom="@+id/textView2"
android:layout_toEndOf="@+id/textview"
android:textSize="25dp"
android:layout_toRightOf="@+id/textview" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="login"
android:id="@+id/button"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/textview"
android:layout_toStartOf="@+id/textview" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:id="@+id/button2"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/textview"
android:layout_toEndOf="@+id/textview" />
</RelativeLayout>
3. res/values/string.xml:
<resources>
<string name="app_name">AaaJ Marketing</string>
<string name="Real State Agents">Real State Agents!</string>
<string name="action_settings">Settings</string>
</resources>
4. AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sairamkrishna.myapplication" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
KL University, Department of Computer Science and
Engineering 84|page
Ste
p
Description
You will use Android studio to create an Android application and name it as
myapplication77 under a package com.example.myapplication77. While creating this
project, make sure you Target SDK and Compile With at the latest version of Android
SDK to use higher levels of APIs.
Modify src/MainActivity.java file and add required code to take care of sending
email.
Run the application to launch Android emulator and verify the result of the changes
done in the application.
Table 9 Description for Running Email App
src/com.example.Myapplication77/MainActivity.java.
package com.example.tutorialspoint;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
emailIntent.setData(Uri.parse("mailto:"));
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
emailIntent.putExtra(Intent.EXTRA_CC, CC);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Your subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message goes here");
try {
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
finish();
KL University, Department of Computer Science and
Engineering 87|page
res/layout/activity_main.xml file :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sending Mail Example"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textSize="30dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tutorials point "
android:textColor="#ff87ff09"
android:textSize="30dp"
android:layout_above="@+id/imageButton"
android:layout_alignRight="@+id/imageButton"
android:layout_alignEnd="@+id/imageButton" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton"
android:src="@drawable/abc"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/sendEmail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/compose_email"/>
</LinearLayout>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.tutorialspoint.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
KL University, Department of Computer Science and
Engineering 90|page
CHAPTER-10
SCREEN SHOTS FOR APPS DEVELOPMENT ON
STOREONGO
APPLICATION LOGIN :
App Launch:
CHAPTER-11
CONCLUSION AND FUTURE SCOPE
CHAPTER-12
BIBILIOGRAPHY
Bibliography
http://storeongo.com/
http://storeongo.com:8081/Services/getMasters?type=allMalls
http://storeongo.com/MobileBuild/consumerApp
http://storeongo.com/Ams/home?showAllAppTabs=true¤tPage=home
http://storeongo.com/Ams/View?biCategory=Products
http://storeongo.com/Ams/viewServiceJobs?biCategory=Services
http://storeongo.com/ams/galleryview?jobId=0
http://storeongo.com/Application/howItWorks
CHAPTER-13
GLOSSARY