events android documentation - amazon web...

139
OVERVIEW: Thanks for purchasing the Event App Template with Wordpress Backend. There are two folders. Event Wordpress folder should be uploaded onto your web hosting, and Event Android App contains the app code can be edited with Eclipse. WORDPRESS SETUP: 1. Purchase the wordpress events plug-in from link below: http://eventsmanagerpro.com/gopro/ 2. Save the Product/License Key that you receive after purchase. 3. Now upload all the files from Event Wordpress to your server and make sure that parent directory is 'events' and it must be at root so that it can correctly points to http://www.mysiteurl.com/events/ 4. Also, upload the database file (events_db.sql) that we provided to your server. To upload the db follow the below steps: a) Login to your cpanel (phpmyadmin) and you will see mysql database option there b) Create a new mysql database; give it a name whatever you want. c) Now open that database and you will see the import sql. So just select the SQL file events_db.sql provided to you and it will auto populate the tables and all required data. d) Finally, Open the “wp-config.php” file in text editor and update the db name, username and password with your db name and password and then save the file. 5. Now in 'wp_options' table, replace the current site URL http:// www.myapptemplates.com by your new site URL: http://www.mysiteurl.com MyAppTemplates Events Android documentation Android Template App

Upload: others

Post on 18-Jun-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

OVERVIEW: Thanks for purchasing the Event App Template with Wordpress Backend. There are two folders. Event Wordpress folder should be uploaded onto your web hosting, and Event Android App contains the app code can be edited with Eclipse.

WORDPRESS SETUP: 1. Purchase the wordpress events plug-in from link below: http://eventsmanagerpro.com/gopro/ 2. Save the Product/License Key that you receive after purchase. 3. Now upload all the files from Event Wordpress to your server and make sure that parent directory is 'events' and it must be at root so that it can correctly points to http://www.mysiteurl.com/events/ 4. Also, upload the database file (events_db.sql) that we provided to your server. To upload the db follow the below steps: a) Login to your cpanel (phpmyadmin) and you will see mysql database option there b) Create a new mysql database; give it a name whatever you want. c) Now open that database and you will see the import sql. So just select the SQL file events_db.sql provided to you and it will auto populate the tables and all required data. d) Finally, Open the “wp-config.php” file in text editor and update the db name, username and password with your db name and password and then save the file. 5. Now in 'wp_options' table, replace the current site URL http:// www.myapptemplates.com by your new site URL: http://www.mysiteurl.com

MyAppTemplates

Events Android documentation Android Template App

Page 2: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

www.myapptemplates.com

6. Now launch http://www.mysiteurl.com/events/wp- admin/edit.php? post_type=event&page=events-manager-options#general in your browser and login using username: root and password: twladmin123 7. After login you will see option of "Pro Member Key", just paste your License key there that you saved in step-2 above. 8. Add your Twitter, Facebook and Instagram into the backend so the app pulls in your feed details on the Feed Screen. Change "webservices/tweet-fb.php" to your own account details only in this file. 9. For your reference, all the web-services/API functions can be found in \wp-content\plugins\custom-code-sanjeev\custom-code-sanjeev.php 9. Now add some data! You can add events by logging in to http:// www.mysiteurl.com/events/wp-admin/ and after adding events you can view them at http://www.mysiteurl.com/events and these same events will also appear in your Events Android app.

Usage instructions:

On Eclipse: Make sure that you have configured the Eclipse with Android ADT Plugin and also installed JDK 7 and Android SDK with latest plateforms. For detail you can visit at: http://developer.android.com/sdk/index.html After Eclipse is fully setup, open the Eclipse, Go to Files menu then select Import-> Existing project into workspace -> Browse, then select for all the projects (Main Template project and all the related Library files bundled in the Zip provided to you) then click on Finish. Sometime Eclipse may show errors about Library project missing, for that just Right click on Project -> Properties -> Android-> Scroll down -> Remove all the lib projects that has Red cross -> Click Apply then OK -> Reopen this window and Add back those projects -> Click Apply then OK

Page 3: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Important Class files: All the Activity classes can be found in Main package i.e. com.events All the Fragments and UI components can be found in ui Package i.e.

com.events.ui All the custom code classes can be found in custom package i.e.

com.events.custom All the Java bean classes are located in model package i.e.

com.events.model All the database operation classes are located in database package i.e.

com.events.database All the Web API call related classes are located in web package i.e.

com.events.web You can put all the Utility classes in utils package i.e. com.events.utils

Photoshop files: The Photoshop files can be found in the ‘PSD’ folder. They are layered - to use, simply open them up in your design tool of choice (i.e. Adobe Photoshop). ========================================== Below you will find detailed source code documentation, that will help you in using and making modifications to this template. Do not hesitate to email at: [email protected] should you run into any issues.

Page 4: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Contents Class About.............................................................................................................................................. 10

Constructor Detail ....................................................................................................................... 10

Method Detail ............................................................................................................................. 10

Class BookTkt .......................................................................................................................................... 10

Field Detail .................................................................................................................................. 11

Constructor Detail ....................................................................................................................... 11

Method Detail ............................................................................................................................. 11

Class Browser .......................................................................................................................................... 12

Field Detail .................................................................................................................................. 13

Constructor Detail ....................................................................................................................... 13

Method Detail ............................................................................................................................. 13

Class CalendarAdapter ........................................................................................................................ 13

Field Detail .................................................................................................................................. 14

Constructor Detail ....................................................................................................................... 16

Method Detail ............................................................................................................................. 16

Class CalendarView ................................................................................................................................. 18

o Nested Class Summary ................................................................................................................ 18

Field Detail .................................................................................................................................. 19

Constructor Detail ....................................................................................................................... 20

Method Detail ............................................................................................................................. 20

Class Commons ..................................................................................................................................... 22

Constructor Detail ....................................................................................................................... 22

Method Detail ............................................................................................................................. 23

Class Const ............................................................................................................................................ 27

Field Detail .................................................................................................................................. 27

Constructor Detail ....................................................................................................................... 30

Class CustomActivity ............................................................................................................................... 30

Field Detail .................................................................................................................................. 30

Page 5: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Constructor Detail ....................................................................................................................... 31

Method Detail ............................................................................................................................. 31

Class CustomFragment ........................................................................................................................... 33

Field Detail .................................................................................................................................. 34

Constructor Detail ....................................................................................................................... 34

Method Detail ............................................................................................................................. 34

Class Data .............................................................................................................................................. 36

Field Detail .................................................................................................................................. 36

Constructor Detail ....................................................................................................................... 37

Method Detail ............................................................................................................................. 38

Interface DateChangeListener ................................................................................................................ 40

o Method Summary ................................................................................................................... 41

o Method Detail ..................................................................................................................... 41

Class DbAdapter ...................................................................................................................................... 41

o Nested Class Summary ................................................................................................................ 42

Field Detail .................................................................................................................................. 42

Constructor Detail ....................................................................................................................... 42

Method Detail ............................................................................................................................. 42

Class DbAdapter.DatabaseHelper ........................................................................................................... 43

Constructor Detail ....................................................................................................................... 44

Method Detail ............................................................................................................................. 44

Class DbConst ....................................................................................................................................... 44

Class DbConst.Fields ............................................................................................................................... 45

Field Detail .................................................................................................................................. 45

Constructor Detail ....................................................................................................................... 45

Class DbHelper...................................................................................................................................... 46

Field Detail .................................................................................................................................. 46

Constructor Detail ....................................................................................................................... 46

Method Detail ............................................................................................................................. 47

Class Event ............................................................................................................................................ 48

Field Detail .................................................................................................................................. 49

Page 6: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Constructor Detail ....................................................................................................................... 51

Method Detail ............................................................................................................................. 52

Class EventDetail ..................................................................................................................................... 59

Field Detail .................................................................................................................................. 60

Constructor Detail ....................................................................................................................... 60

Method Detail ............................................................................................................................. 60

Class EventDetailActivity ......................................................................................................................... 63

Constructor Detail ....................................................................................................................... 63

Method Detail ............................................................................................................................. 63

Class ExceptionHandler ....................................................................................................................... 64

Field Detail .................................................................................................................................. 64

Constructor Detail ....................................................................................................................... 64

Method Detail ............................................................................................................................. 65

Class Feed .............................................................................................................................................. 65

Field Detail .................................................................................................................................. 65

Constructor Detail ....................................................................................................................... 67

Method Detail ............................................................................................................................. 67

Class FeedDetail ...................................................................................................................................... 70

Constructor Detail ....................................................................................................................... 70

Method Detail ............................................................................................................................. 71

Class FeedList .......................................................................................................................................... 71

o Nested Class Summary ................................................................................................................ 71

Field Detail .................................................................................................................................. 72

Constructor Detail ....................................................................................................................... 72

Method Detail ............................................................................................................................. 72

Class ImageLoader .................................................................................................................................. 73

o Nested Class Summary ................................................................................................................ 73

Interface ImageLoader.ImageLoadedListener ........................................................................................ 74

o Method Summary ................................................................................................................... 74

o Method Detail ..................................................................................................................... 75

Class ImageUtils ...................................................................................................................................... 75

Page 7: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Field Detail .................................................................................................................................. 76

Constructor Detail ....................................................................................................................... 78

Method Detail ............................................................................................................................. 78

Class ImgTouchEffect .......................................................................................................................... 84

Constructor Detail ....................................................................................................................... 85

Method Detail ............................................................................................................................. 85

Class LeftNavAdapter .......................................................................................................................... 85

Field Detail .................................................................................................................................. 85

Constructor Detail ....................................................................................................................... 86

Method Detail ............................................................................................................................. 86

Class Log ................................................................................................................................................ 87

Constructor Detail ....................................................................................................................... 87

Method Detail ............................................................................................................................. 87

Class Login ............................................................................................................................................... 88

Constructor Detail ....................................................................................................................... 89

Method Detail ............................................................................................................................. 89

Class MainActivity ................................................................................................................................... 90

Field Detail .................................................................................................................................. 90

Constructor Detail ....................................................................................................................... 91

Method Detail ............................................................................................................................. 91

Class MapViewActivity ............................................................................................................................ 94

Constructor Detail ....................................................................................................................... 94

Method Detail ............................................................................................................................. 94

Class MapViewer ..................................................................................................................................... 95

Field Detail .................................................................................................................................. 95

Constructor Detail ....................................................................................................................... 96

Method Detail ............................................................................................................................. 96

Class More ............................................................................................................................................... 97

Constructor Detail ....................................................................................................................... 98

Method Detail ............................................................................................................................. 98

Class MoreDetail ..................................................................................................................................... 99

Page 8: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Constructor Detail ....................................................................................................................... 99

Method Detail ............................................................................................................................. 99

Class MyTickets ..................................................................................................................................... 100

o Nested Class Summary .............................................................................................................. 100

Field Detail ................................................................................................................................ 100

Constructor Detail ..................................................................................................................... 100

Method Detail ........................................................................................................................... 101

Class PagingFragment ........................................................................................................................... 102

Field Detail ................................................................................................................................ 102

Constructor Detail ..................................................................................................................... 103

Method Detail ........................................................................................................................... 103

Class Programs ...................................................................................................................................... 105

o Nested Class Summary .............................................................................................................. 105

Field Detail ................................................................................................................................ 105

Constructor Detail ..................................................................................................................... 105

Method Detail ........................................................................................................................... 106

Class Register ........................................................................................................................................ 107

Constructor Detail ..................................................................................................................... 107

Method Detail ........................................................................................................................... 107

Class SplashScreen .............................................................................................................................. 108

Field Detail ................................................................................................................................ 108

Constructor Detail ..................................................................................................................... 109

Method Detail ........................................................................................................................... 109

Class StaticData .................................................................................................................................. 110

Field Detail ................................................................................................................................ 110

Constructor Detail ..................................................................................................................... 111

Method Detail ........................................................................................................................... 111

Class Status .......................................................................................................................................... 113

Field Detail ................................................................................................................................ 113

Constructor Detail ..................................................................................................................... 114

Method Detail ........................................................................................................................... 115

Page 9: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Class TouchEffect ............................................................................................................................... 117

Constructor Detail ..................................................................................................................... 117

Method Detail ........................................................................................................................... 117

Class Utils ............................................................................................................................................ 118

Constructor Detail ..................................................................................................................... 118

Method Detail ........................................................................................................................... 118

Class WebAccess ................................................................................................................................... 129

Field Detail ................................................................................................................................ 129

Constructor Detail ..................................................................................................................... 131

Method Detail ........................................................................................................................... 132

Class WebHelper ................................................................................................................................... 135

Constructor Detail ..................................................................................................................... 135

Method Detail ........................................................................................................................... 135

Page 10: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.ui

Class About

public class About

extends CustomFragment

The Class About is the Fragment class that is launched when the user clicks on

About option in Left navigation drawer and it simply shows a dummy text for

About. You can customize this to display actual contents.

Constructor Detail o About

public About()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

com.events

Class BookTkt

Page 11: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class BookTkt

extends CustomActivity

The Class BookTkt is the Activity class that is launched when the user clicks on

Register option in Event's detail page and it shows interface to user for

selecting the seats with option to add his comments. Following to this page is

the payment screen where user need to make the payment to book his/her

seats, if Event is not free else it will just show success/fail response.

Field Detail o e

private Event e

The event to be booked.

Constructor Detail o BookTkt

public BookTkt()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o loadSpaces

private void loadSpaces()

Load number of available seats for this Event.

o onClick

public void onClick(android.view.View v)

Specified by:

Page 12: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomActivity

o bookTkt

private void bookTkt()

This method calls the API to book the ticket and depending on the

response if the Event is Free then it shows success/fail response else it

open the Payment screen.

o onActivityResult o public void onActivityResult(int requestCode,

o int resultCode,

android.content.Intent data)

Overrides:

onActivityResult in class android.support.v4.app.FragmentActivity

Class Browser

public class Browser

extends CustomActivity

The main Browser screen, launched for user to make the payment for the

Events which are not Free. This screen simply shows a Webview that load the

payment page url which allow user to make payment.

Page 13: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Field Detail o web

private android.webkit.WebView web

The web.

Constructor Detail o Browser

public Browser()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o onBackPressed

public void onBackPressed()

Overrides:

onBackPressed in class android.support.v4.app.FragmentActivity

com.events.calendar

Class CalendarAdapter

public class CalendarAdapter

extends android.widget.BaseAdapter

Page 14: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Class CalendarAdapter is the Adapter class for Calendar view to display

dates in Grid format.

Field Detail o mContext

private android.app.Activity mContext

The context.

o month

private java.util.Calendar month

The month.

o pmonth

public java.util.GregorianCalendar pmonth

The calendar instance for previous month.

o pmonthmaxset

public java.util.GregorianCalendar pmonthmaxset

Calendar instance for previous month for getting complete view.

o selectedDate

private java.util.GregorianCalendar selectedDate

The selected date.

o dateChangeListener

private DateChangeListener dateChangeListener

The date change listener.

o firstDay

int firstDay

The first day.

Page 15: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o maxWeeknumber

int maxWeeknumber

The max week number.

o maxP

int maxP

The previous month maximum day.

o calMaxP

int calMaxP

The Calendar max off days.

o lastWeekDay

int lastWeekDay

The last week day.

o leftDays

int leftDays

The left days.

o mnthlength

int mnthlength

The month length.

o itemvalue

java.lang.String itemvalue

The current date string.

o curentDateString

java.lang.String curentDateString

Page 16: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The current date string.

o df

java.text.DateFormat df

The DateFormat.

o items

private java.util.ArrayList<Event> items

The items.

o dayString

public static java.util.List<java.lang.String> dayString

The day string.

o previousView

private android.view.View previousView

The previous view.

Constructor Detail o CalendarAdapter o public CalendarAdapter(android.app.Activity c,

java.util.GregorianCalendar monthCalendar)

Instantiates a new calendar adapter.

Parameters:

c - the c

monthCalendar - the month calendar

Method Detail o setDateChangeListener

public void setDateChangeListener(DateChangeListener dateChangeLi

stener)

Page 17: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Sets the date change listener.

Parameters:

dateChangeListener - the new date change listener

o setItems

public void setItems(java.util.ArrayList<Event> items)

Sets the items.

Parameters:

items - the new items

o getCount

public int getCount()

o getItem

public java.lang.Object getItem(int position)

o getItemId

public long getItemId(int position)

o getView o public android.view.View getView(int position,

o android.view.View convertView,

android.view.ViewGroup parent)

o setSelected o public android.view.View setSelected(int position,

android.view.View view)

Sets the selected date.

Parameters:

position - the position

view - the view

Returns:

Page 18: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

the view

o refreshDays

public void refreshDays()

Refresh days.

o getMaxP

private int getMaxP()

Gets the previous month maximum day.

Returns:

the max day

com.events.calendar

Class CalendarView

public class CalendarView

extends CustomFragment

implements DateChangeListener

The Class CalendarView is Fragment class to hold the Calendar view.

o Nested Class Summary

Page 19: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Nested Classes

Modifier and

Type Class and Description

private

class

CalendarView.EventAdapter

The Class EventAdapter is the adapter class that is used show list of

Events for a selected date in the ListView.

Field Detail o month

public java.util.GregorianCalendar month

The item month.

o itemmonth

public java.util.GregorianCalendar itemmonth

The item month.

o adapter

public CalendarAdapter adapter

The adapter.

o handler

public android.os.Handler handler

The handler.

o items

public java.util.ArrayList<java.lang.String> items

The items.

o events

private final java.util.ArrayList<Event> events

Page 20: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The events.

o list

private android.widget.ListView list

The list.

o eventSel

private java.util.ArrayList<Event> eventSel

The events for selected date.

o calendarUpdater

public java.lang.Runnable calendarUpdater

The calendar updater to update the Calendar grids and data.

Constructor Detail o CalendarView

public CalendarView()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o initCalendarView

private void initCalendarView(android.view.View v)

Initialize the calendar view.

Parameters:

v - the v

Page 21: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o setupEventList

private void setupEventList(android.view.View v)

Set the up event list.

Parameters:

v - the root view

o setNextMonth

protected void setNextMonth()

Sets the next month.

o setPreviousMonth

protected void setPreviousMonth()

Sets the previous month.

o showToast

protected void showToast(java.lang.String string)

Show toast.

Parameters:

string - the string message

o refreshCalendar

public void refreshCalendar(android.view.View v)

Refresh calendar.

Parameters:

v - the v

o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,

android.view.MenuInflater inflater)

Page 22: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Overrides:

onCreateOptionsMenu in class android.support.v4.app.Fragment

o onDateChange o public void onDateChange(int position,

long d)

Description copied from interface: DateChangeListener

On date change.

Specified by:

onDateChange in interface DateChangeListener

Parameters:

position - the position

d - the sel

com.events.utils

Class Commons

public class Commons

extends java.lang.Object

The Class Commons.

Constructor Detail

Page 23: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o Commons

public Commons()

Method Detail o getTimeSpan

public static java.lang.String getTimeSpan(long timeStr)

Gets the time span.

Parameters:

timeStr - the time str

Returns:

the time span

o isEmpty

public static boolean isEmpty(java.lang.String str)

Checks if is empty.

Parameters:

str - the str

Returns:

true, if is empty

o getDateTime

public static java.lang.String getDateTime()

Gets the date time.

Returns:

the date time

o stringToCalander

Page 24: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o public static void stringToCalander(java.lang.String date,

java.util.Calendar cal)

String to calander.

Parameters:

date - the date

cal - the cal

o dateTimeToMillis

public static long dateTimeToMillis(java.lang.String datetime)

Date time to millis.

Parameters:

datetime - the datetime

Returns:

the long

o dateTimeToMillis1

public static long dateTimeToMillis1(java.lang.String datetime)

Date time to millis1.

Parameters:

datetime - the datetime

Returns:

the long

o millsToDateTime

public static java.lang.String millsToDateTime(long mills)

Mills to date time.

Page 25: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

mills - the mills

Returns:

the string

o millsToDate

public static java.lang.String millsToDate(long mills)

Mills to date.

Parameters:

mills - the mills

Returns:

the string

o millsToTime

public static java.lang.String millsToTime(long mills)

Mills to time.

Parameters:

mills - the mills

Returns:

the string

o strToDouble

public static double strToDouble(java.lang.String str)

Str to double.

Parameters:

Page 26: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

str - the str

Returns:

the double

o strToInt

public static int strToInt(java.lang.String str)

Str to int.

Parameters:

str - the str

Returns:

the int

o strToLong

public static long strToLong(java.lang.String str)

Str to long.

Parameters:

str - the str

Returns:

the long

o isBeforeToday

public static boolean isBeforeToday(java.lang.String date)

Checks if is before today.

Parameters:

date - the date

Page 27: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Returns:

true, if is before today

o isBetweenToday o public static boolean isBetweenToday(java.lang.String start,

java.lang.String end)

Checks if is between today.

Parameters:

start - the start

end - the end

Returns:

true, if is between today

com.events.utils

Class Const

public class Const

extends java.lang.Object

The Class Const.

Field Detail o REQ_LOGIN

Page 28: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public static final int REQ_LOGIN

The Constant REQ_LOGIN.

See Also:

Constant Field Values

o REQ_BOOK

public static final int REQ_BOOK

The Constant REQ_BOOK.

See Also:

Constant Field Values

o EXTRA_DATA

public static final java.lang.String EXTRA_DATA

The Constant EXTRA_DATA.

See Also:

Constant Field Values

o EXTRA_DATA1

public static final java.lang.String EXTRA_DATA1

The Constant EXTRA_DATA1.

See Also:

Constant Field Values

o USER_ID

public static final java.lang.String USER_ID

The Constant USER_ID.

Page 29: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

See Also:

Constant Field Values

o PAGE_SIZE_100

public static final int PAGE_SIZE_100

The Constant PAGE_SIZE_100.

See Also:

Constant Field Values

o PAGE_SIZE_30

public static final int PAGE_SIZE_30

The Constant PAGE_SIZE_30.

See Also:

Constant Field Values

o TEN_MIN

public static final long TEN_MIN

The Constant TEN_MIN.

See Also:

Constant Field Values

o ROOT_DIR

public static final java.io.File ROOT_DIR

The Constant ROOT_DIR.

o WEB_DIR

public static final java.io.File WEB_DIR

Page 30: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Constant WEB_DIR.

o CACHE_DIR

public static final java.io.File CACHE_DIR

The Constant CACHE_DIR.

Constructor Detail o Const

public Const()

com.events.custom

Class CustomActivity

Direct Known Subclasses:

BookTkt, Browser, EventDetailActivity, FeedDetail, Login, MainActivity, MapViewActivity, Mor

eDetail, Register

public class CustomActivity

extends android.support.v4.app.FragmentActivity

implements android.view.View.OnClickListener

This is a common activity that all other activities of the app can extend to

inherit the common behaviors like implementing a common interface that can

be used in all child activities.

Field Detail

Page 31: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o TOUCH

public static final TouchEffect TOUCH

Apply this Constant as touch listener for views to provide alpha touch

effect. The view must have a Non-Transparent background.

o iTOUCH

public static final ImgTouchEffect iTOUCH

The Constant iTOUCH.

o loader

protected ImageLoader loader

The loader.

o THIS

public CustomActivity THIS

The this.

Constructor Detail o CustomActivity

public CustomActivity()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class android.support.v4.app.FragmentActivity

o setupActionBar

protected void setupActionBar()

This method will setup the top title bar (Action bar) content and display

values. It will also setup the custom background theme for ActionBar.

Page 32: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

You can override this method to change the behavior of ActionBar for

particular Activity

o setTouchNClick

public android.view.View setTouchNClick(int id)

Sets the touch and click listener for a view with given id.

Parameters:

id - the id

Returns:

the view on which listeners applied

o setClick

public android.view.View setClick(int id)

Sets the click listener for a view with given id.

Parameters:

id - the id

Returns:

the view on which listener is applied

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

o showProgressDia

public android.app.ProgressDialog showProgressDia(int msg)

Show progress dia.

Page 33: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

msg - the msg

Returns:

the progress dialog

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class android.app.Activity

com.events.custom

Class CustomFragment

Direct Known Subclasses:

About, CalendarView, EventDetail, FeedList, MapViewer, More, PagingFragment

public class CustomFragment

extends android.support.v4.app.Fragment

implements android.view.View.OnClickListener

Page 34: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

This is a common Fragment that all other Fragments of the app can extend to

inherit the common behaviors like implementing a common interface that can

be used in all child Fragments.

Field Detail o parent

public CustomActivity parent

The parent activity of this fragment.

o bmNoImg

protected android.graphics.Bitmap bmNoImg

The default no img bitmap.

o loader

protected ImageLoader loader

The iamge loader.

o arg

private android.os.Bundle arg

The Bundle arg.

Constructor Detail o CustomFragment

public CustomFragment()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

Page 35: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onCreateView in class android.support.v4.app.Fragment

o setArg

public void setArg(android.os.Bundle arg)

Sets the arg.

Parameters:

arg - the new arg

o getArg

public android.os.Bundle getArg()

Gets the arg.

Returns:

the arg

o setTouchNClick

public android.view.View setTouchNClick(android.view.View v)

Sets the touch n click.

Parameters:

v - the v

Returns:

the view

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

o onDestroyView

Page 36: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public void onDestroyView()

Overrides:

onDestroyView in class android.support.v4.app.Fragment

com.events.model

Class Data

public class Data

extends java.lang.Object

The Class Data is a simple Java Bean that is used to hold Name, Detail and

image pairs.

Field Detail o title1

private java.lang.String title1

The title1.

o title2

private java.lang.String title2

The title2.

o desc

private java.lang.String desc

The description.

Page 37: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o image1

private int image1

The image resource id.

o image2

private int image2

The image2.

Constructor Detail o Data o public Data(java.lang.String title1,

o java.lang.String title2,

o java.lang.String desc,

int image1)

Instantiates a new data.

Parameters:

title1 - the title1

title2 - the title2

desc - the desc

image1 - the image1

o Data o public Data(java.lang.String title1,

o int image1,

int image2)

Instantiates a new data.

Parameters:

title1 - the title1

image1 - the image1

image2 - the image2

Page 38: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Method Detail o getTitle1

public java.lang.String getTitle1()

Gets the title1.

Returns:

the title1

o setTitle1

public void setTitle1(java.lang.String title1)

Sets the title1.

Parameters:

title1 - the new title1

o getTitle2

public java.lang.String getTitle2()

Gets the title2.

Returns:

the title2

o setTitle2

public void setTitle2(java.lang.String title2)

Sets the title2.

Parameters:

title2 - the new title2

o getDesc

public java.lang.String getDesc()

Page 39: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Gets the desc.

Returns:

the desc

o setDesc

public void setDesc(java.lang.String desc)

Sets the desc.

Parameters:

desc - the new desc

o getImage1

public int getImage1()

Gets the image1.

Returns:

the image1

o setImage1

public void setImage1(int image1)

Sets the image1.

Parameters:

image1 - the new image1

o getImage2

public int getImage2()

Gets the image2.

Returns:

Page 40: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

the image2

o setImage2

public void setImage2(int image2)

Sets the image2.

Parameters:

image2 - the new image2

com.events.calendar

Interface DateChangeListener

All Known Implementing Classes: CalendarView

public interface DateChangeListener

The listener interface for receiving dateChange events. The class that is

interested in processing a dateChange event implements this interface, and

the object created with that class is registered with a component using the

component's addDateChangeListener method. When the dateChange event occurs, that object's appropriate method is invoked.

See Also:

Page 41: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

DateChangeEvent

o Method Summary

Methods

Modifier and Type Method and Description

void onDateChange(int position, long sel)

On date change.

o Method Detail onDateChange

void onDateChange(int position,

long sel)

On date change.

Parameters:

position - the position

sel - the sel

com.events.database

Class DbAdapter

Page 42: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class DbAdapter

extends java.lang.Object

The Class DbAdapter is the adapter class for our Sqlite Database.

o Nested Class Summary

Nested Classes

Modifier and Type Class and Description

private static class DbAdapter.DatabaseHelper

The Class DatabaseHelper is the SQLiteOpenHelper.

Field Detail o dbHelper

private DbAdapter.DatabaseHelper dbHelper

The db helper.

o ctx

private final android.content.Context ctx

The Context.

Constructor Detail o DbAdapter

public DbAdapter(android.content.Context ctx)

Instantiates a new db adapter.

Parameters:

ctx - the ctx

Method Detail o open o public android.database.sqlite.SQLiteDatabase open()

Page 43: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

throws

android.database.SQLException

Open database

Returns:

the sQ lite database

Throws:

android.database.SQLException - the sQL exception

o close

public void close()

Close database

com.events.database

Class DbAdapter.DatabaseHelper

Enclosing class: DbAdapter

private static class DbAdapter.DatabaseHelper

extends android.database.sqlite.SQLiteOpenHelper

Page 44: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Class DatabaseHelper is the SQLiteOpenHelper.

Constructor Detail o DbAdapter.DatabaseHelper

DbAdapter.DatabaseHelper(android.content.Context context)

Instantiates a new database helper.

Parameters:

context - the context

Method Detail o onCreate

public void onCreate(android.database.sqlite.SQLiteDatabase db)

Specified by:

onCreate in class android.database.sqlite.SQLiteOpenHelper

o onUpgrade o public void onUpgrade(android.database.sqlite.SQLiteDatabase db,

o int oldVersion,

int newVersion)

Specified by:

onUpgrade in class android.database.sqlite.SQLiteOpenHelper

com.events.database

Class DbConst

Page 45: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class DbConst

extends java.lang.Object

The Class DbConst holds all the Database constants like database name, table

names and field names and It also includes the strings for creating tables in

Sqlite db.

com.events.database

Class DbConst.Fields

Enclosing class: DbConst

private static class DbConst.Fields

extends java.lang.Object

The Class Fields.

Field Detail o name

java.lang.String name

The name.

o type

java.lang.String type

The type.

Constructor Detail o DbConst.Fields o DbConst.Fields(java.lang.String name,

java.lang.String type)

Instantiates a new fields.

Page 46: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

name - the name

type - the type

com.events.database

Class DbHelper

public class DbHelper

extends java.lang.Object

The Class DbHelper holds all the helper methods that query to sqlite database.

Field Detail o dbAdapter

private static DbAdapter dbAdapter

The db adapter.

o db

private static android.database.sqlite.SQLiteDatabase db

The db.

Constructor Detail o DbHelper

public DbHelper()

Page 47: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Method Detail o init

public static void init(android.content.Context ctx)

Inits the.

Parameters:

ctx - the ctx

o isOpen

public static boolean isOpen()

Checks if is open.

Returns:

true, if is open

o close

public static void close()

Close.

o setEventFavorite o public static void setEventFavorite(Event a,

boolean isFav)

Sets the event favorite.

Parameters:

a - the a

isFav - the is fav

o isEventFavorite

public static boolean isEventFavorite(java.lang.String id)

Checks if is event favorite.

Page 48: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

id - the id

Returns:

true, if is event favorite

o getFavouriteEvents

public

static java.util.ArrayList<Event> getFavouriteEvents(int page)

Gets the favourite events.

Parameters:

page - the page

Returns:

the favourite events

com.events.model

Class Event

public class Event

extends java.lang.Object

implements java.io.Serializable

Page 49: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Class Event is a simple Java Bean that is used to hold data related to an

Event like title, date etc.

Field Detail o serialVersionUID

private static final long serialVersionUID

The Constant serialVersionUID.

See Also:

Constant Field Values

o title

private java.lang.String title

The title.

o desc

private java.lang.String desc

The desc.

o startDate

private java.lang.String startDate

The start date.

o startTime

private java.lang.String startTime

The start time.

o startDateTime

private long startDateTime

The start date time.

o endDate

Page 50: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

private java.lang.String endDate

The end date.

o endTime

private java.lang.String endTime

The end time.

o endDateTime

private long endDateTime

The end date time.

o location

private java.lang.String location

The location.

o latitude

private double latitude

The latitude.

o longitude

private double longitude

The longitude.

o price

private double price

The price.

o availSpace

private int availSpace

The avail space.

Page 51: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o isFav

private boolean isFav

The is fav.

o isBooked

private boolean isBooked

The is booked.

o image

private java.lang.String image

The image.

o id

private java.lang.String id

The id.

Constructor Detail o Event o public Event(java.lang.String title,

o java.lang.String date,

o java.lang.String time,

o java.lang.String location,

int image)

Instantiates a new event.

Parameters:

title - the title

date - the date

time - the time

location - the location

image - the image

Page 52: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o Event

public Event()

Instantiates a new event.

Method Detail o getTitle

public java.lang.String getTitle()

Gets the title.

Returns:

the title

o setTitle

public void setTitle(java.lang.String title)

Sets the title.

Parameters:

title - the new title

o getDesc

public java.lang.String getDesc()

Gets the desc.

Returns:

the desc

o setDesc

public void setDesc(java.lang.String desc)

Sets the desc.

Parameters:

Page 53: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

desc - the new desc

o getStartDate

public java.lang.String getStartDate()

Gets the date.

Returns:

the date

o setStartDate

public void setStartDate(java.lang.String date)

Sets the date.

Parameters:

date - the new date

o getStartTime

public java.lang.String getStartTime()

Gets the time.

Returns:

the time

o setStartTime

public void setStartTime(java.lang.String time)

Sets the time.

Parameters:

time - the new time

o getStartDateTime

Page 54: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public long getStartDateTime()

Gets the start date time.

Returns:

the start date time

o getEndDate

public java.lang.String getEndDate()

Gets the end date.

Returns:

the end date

o setEndDate

public void setEndDate(java.lang.String endDate)

Sets the end date.

Parameters:

endDate - the new end date

o getEndTime

public java.lang.String getEndTime()

Gets the end time.

Returns:

the end time

o setEndTime

public void setEndTime(java.lang.String endTime)

Sets the end time.

Page 55: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

endTime - the new end time

o getEndDateTime

public long getEndDateTime()

Gets the end date time.

Returns:

the end date time

o getLocation

public java.lang.String getLocation()

Gets the location.

Returns:

the location

o setLocation

public void setLocation(java.lang.String location)

Sets the location.

Parameters:

location - the new location

o getImage

public java.lang.String getImage()

Gets the image.

Returns:

the image

Page 56: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o setImage

public void setImage(java.lang.String image)

Sets the image.

Parameters:

image - the new image

o getId

public java.lang.String getId()

Gets the id.

Returns:

the id

o setId

public void setId(java.lang.String id)

Sets the id.

Parameters:

id - the new id

o getLatitude

public double getLatitude()

Gets the latitude.

Returns:

the latitude

o setLatitude

public void setLatitude(double latitude)

Page 57: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Sets the latitude.

Parameters:

latitude - the new latitude

o getLongitude

public double getLongitude()

Gets the longitude.

Returns:

the longitude

o setLongitude

public void setLongitude(double longitude)

Sets the longitude.

Parameters:

longitude - the new longitude

o getPrice

public double getPrice()

Gets the price.

Returns:

the price

o setPrice

public void setPrice(double price)

Sets the price.

Parameters:

Page 58: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

price - the new price

o getAvailSpace

public int getAvailSpace()

Gets the avail space.

Returns:

the avail space

o setAvailSpace

public void setAvailSpace(int availSpace)

Sets the avail space.

Parameters:

availSpace - the new avail space

o isFav

public boolean isFav()

Checks if is fav.

Returns:

true, if is fav

o setFav

public void setFav(boolean isFav)

Sets the fav.

Parameters:

isFav - the new fav

o isBooked

Page 59: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public boolean isBooked()

Checks if is booked.

Returns:

true, if is booked

o setBooked

public void setBooked(boolean isBooked)

Sets the booked.

Parameters:

isBooked - the new booked

com.events.ui

Class EventDetail

public class EventDetail

extends CustomFragment

The Class EventDetail is the Fragment class that shows the details about an

Event. This Fragment is used inside the EventDetailActivity class. It also show a

Map with a marker on map for showing the location of that event. You need

to write your own logic for loading actual contents related to Events and also

need to show actual location for Event.

Page 60: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Field Detail o mMapView

private com.google.android.gms.maps.MapView mMapView

The map view.

o mMap

private com.google.android.gms.maps.GoogleMap mMap

The Google map.

o e

private Event e

The e.

Constructor Detail o EventDetail

public EventDetail()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o showDetails

private void showDetails(android.view.View v)

Show details.

Parameters:

v - the v

o onPause

Page 61: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public void onPause()

Overrides:

onPause in class android.support.v4.app.Fragment

o onDestroy

public void onDestroy()

Overrides:

onDestroy in class android.support.v4.app.Fragment

o onResume

public void onResume()

Overrides:

onResume in class android.support.v4.app.Fragment

o setupMap o private void setupMap(android.view.View v,

android.os.Bundle savedInstanceState)

Setup and initialize the Google map view.

Parameters:

v - the root view

savedInstanceState - the saved instance state

o setupMarker

private void setupMarker()

This method simply place a few dummy location markers on Map View.

You can write your own logic for loading the locations and placing the

marker for each location as per your need.

o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,

android.view.MenuInflater inflater)

Overrides:

Page 62: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onCreateOptionsMenu in class android.support.v4.app.Fragment

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class android.support.v4.app.Fragment

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomFragment

o bookTicket

private void bookTicket()

Book ticket.

o onActivityResult o public void onActivityResult(int requestCode,

o int resultCode,

android.content.Intent data)

Overrides:

onActivityResult in class android.support.v4.app.Fragment

com.events

Page 63: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Class EventDetailActivity

public class EventDetailActivity

extends CustomActivity

The EventDetailActivity is the activity class that shows the details about an

Event. This is launched when ever user select an Event from the Event listing

or from Events on Map. It also show a Map with a marker on map for showing

the location of that event. You need to write your own logic for loading any

other contents related to Events.

Constructor Detail o EventDetailActivity

public EventDetailActivity()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o addFragment

private void addFragment()

Attach the appropriate fragment with this activity.

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class CustomActivity

Page 64: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.utils

Class ExceptionHandler

public class ExceptionHandler

extends java.lang.Object

implements java.lang.Thread.UncaughtExceptionHandler

The Class ExceptionHandler.

Field Detail o myContext

private final android.content.Context myContext

The my context.

o CRASH_REPORT

public static final java.lang.String CRASH_REPORT

The Constant CRASH_REPORT.

See Also:

Constant Field Values

Constructor Detail o ExceptionHandler

public ExceptionHandler(android.content.Context context)

Instantiates a new exception handler.

Page 65: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

context - the context

Method Detail o uncaughtException o public void uncaughtException(java.lang.Thread thread,

java.lang.Throwable exception)

Specified by:

uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler

com.events.model

Class Feed

public class Feed

extends java.lang.Object

implements java.io.Serializable

The Class Feed is a simple Java Bean that is used to hold the data of a

particular Feed item like title, date etc.

Field Detail o serialVersionUID

private static final long serialVersionUID

The Constant serialVersionUID.

Page 66: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

See Also:

Constant Field Values

o FEED_TW

public static final int FEED_TW

The Constant FEED_TW.

See Also:

Constant Field Values

o FEED_FB

public static final int FEED_FB

The Constant FEED_FB.

See Also:

Constant Field Values

o FEED_IG

public static final int FEED_IG

The Constant FEED_IG.

See Also:

Constant Field Values

o title

private java.lang.String title

The title.

o msg

private java.lang.String msg

Page 67: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The msg.

o link

private java.lang.String link

The link.

o date

private long date

The date.

o image

private java.lang.String image

The image.

o type

private int type

The type.

Constructor Detail o Feed

public Feed()

Method Detail o getTitle

public java.lang.String getTitle()

Gets the title.

Returns:

the title

o setTitle

public void setTitle(java.lang.String title)

Page 68: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Sets the title.

Parameters:

title - the new title

o getMsg

public java.lang.String getMsg()

Gets the msg.

Returns:

the msg

o setMsg

public void setMsg(java.lang.String msg)

Sets the msg.

Parameters:

msg - the new msg

o getLink

public java.lang.String getLink()

Gets the link.

Returns:

the link

o setLink

public void setLink(java.lang.String link)

Sets the link.

Parameters:

Page 69: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

link - the new link

o getDate

public long getDate()

Gets the date.

Returns:

the date

o setDate

public void setDate(long date)

Sets the date.

Parameters:

date - the new date

o getImage

public java.lang.String getImage()

Gets the image.

Returns:

the image

o setImage

public void setImage(java.lang.String image)

Sets the image.

Parameters:

image - the new image

o getType

Page 70: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public int getType()

Gets the type.

Returns:

the type

o setType

public void setType(int type)

Sets the type.

Parameters:

type - the new type

com.events

Class FeedDetail

public class FeedDetail

extends CustomActivity

The Class FeedDetail is the Activity class that is launched when the user clicks

on any Feed item in the Feed list section and it simply load the Feed URL in the

Webview.

Constructor Detail

Page 71: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o FeedDetail

public FeedDetail()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

com.events.ui

Class FeedList

public class FeedList

extends CustomFragment

The Class FeedList is the Fragment class that is launched when the user clicks

on Feed option in Left navigation drawer . It simply shows a dummy list of

Social media Feeds. You can customize this class to display actual Feed listing.

o Nested Class Summary

Nested Classes

Modifier and Type Class and Description

Page 72: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

private class FeedList.ProgramAdapter

The Class FeedAdapter is the adapter class for Feed ListView.

Field Detail o fList

private java.util.ArrayList<Feed> fList

The feed list.

Constructor Detail o FeedList

public FeedList()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o setFeedList

private void setFeedList(android.view.View v)

Setup and initialize the feed list view.

Parameters:

v - the root view

o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,

android.view.MenuInflater inflater)

Overrides:

onCreateOptionsMenu in class android.support.v4.app.Fragment

o onOptionsItemSelected

Page 73: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class android.support.v4.app.Fragment

com.events.utils

Class ImageLoader

java.lang.Object o com.events.utils.ImageUtils

o com.events.utils.ImageLoader

public class ImageLoader

extends ImageUtils

The Class ImageLoader.

o Nested Class Summary

Nested Classes

Modifier and Type Class and Description

static interface ImageLoader.ImageLoadedListener

The listener interface for receiving imageLoaded events.

Page 74: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

class ImageLoader.QueueItem

The Class QueueItem.

class ImageLoader.QueueRunner

The Class QueueRunner.

com.events.utils

Interface ImageLoader.ImageLoadedListener

Enclosing class: ImageLoader

public static interface ImageLoader.ImageLoadedListener

The listener interface for receiving imageLoaded events. The class that is

interested in processing a imageLoaded event implements this interface, and

the object created with that class is registered with a component using the

component's addImageLoadedListener method. When the imageLoaded event occurs, that object's appropriate method is invoked.

See Also:

ImageLoadedEvent

o Method Summary

Page 75: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Methods

Modifier and Type Method and Description

void imageLoaded(android.graphics.Bitmap bm)

Image loaded.

o Method Detail imageLoaded

void imageLoaded(android.graphics.Bitmap bm)

Image loaded.

Parameters:

bm - the bm

com.events.utils

Class ImageUtils

java.lang.Object o com.events.utils.ImageUtils

Direct Known Subclasses: ImageLoader

Page 76: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class ImageUtils

extends java.lang.Object

The Class ImageUtils.

Field Detail o SCALE_NONE

public static final int SCALE_NONE

The Constant SCALE_NONE.

See Also:

Constant Field Values

o SCALE_FITXY

public static final int SCALE_FITXY

The Constant SCALE_FITXY.

See Also:

Constant Field Values

o SCALE_ASPECT

public static final int SCALE_ASPECT

The Constant SCALE_ASPECT.

See Also:

Constant Field Values

Page 77: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o SCALE_CROP

public static final int SCALE_CROP

The Constant SCALE_CROP.

See Also:

Constant Field Values

o SCALE_FIT_CENTER

public static final int SCALE_FIT_CENTER

The Constant SCALE_FIT_CENTER.

See Also:

Constant Field Values

o SCALE_FIT_CENTER_NO_COL

public static final int SCALE_FIT_CENTER_NO_COL

The Constant SCALE_FIT_CENTER_NO_COL.

See Also:

Constant Field Values

o SCALE_FIT_MIN_WH

public static final int SCALE_FIT_MIN_WH

The Constant SCALE_FIT_MIN_WH.

See Also:

Constant Field Values

o SCALE_ASPECT_WIDTH

public static final int SCALE_ASPECT_WIDTH

Page 78: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Constant SCALE_ASPECT_WIDTH.

See Also:

Constant Field Values

o SCALE_ASPECT_HEIGHT

public static final int SCALE_ASPECT_HEIGHT

The Constant SCALE_ASPECT_HEIGHT.

See Also:

Constant Field Values

o SCALE_FIT_WIDTH

public static final int SCALE_FIT_WIDTH

The Constant SCALE_FIT_WIDTH.

See Also:

Constant Field Values

Constructor Detail o ImageUtils

public ImageUtils()

Method Detail o getOrientationFixedFramedImage o public

static android.graphics.Bitmap getOrientationFixedFramedImage(jav

a.io.File f,

o int w,

o int h,

int scaleType)

Gets the orientation fixed framed image.

Parameters:

Page 79: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

f - the f

w - the w

h - the h

scaleType - the scale type

Returns:

the orientation fixed framed image

o getMaskShapedBitmap o public

static android.graphics.Bitmap getMaskShapedBitmap(android.graphi

cs.Bitmap bitmap,

int maskRes)

Gets the mask shaped bitmap.

Parameters:

bitmap - the bitmap

maskRes - the mask res

Returns:

the mask shaped bitmap

o getRoundedCornerBitmap

public

static android.graphics.Bitmap getRoundedCornerBitmap(android.gra

phics.Bitmap bitmap)

Gets the rounded corner bitmap.

Parameters:

bitmap - the bitmap

Returns:

the rounded corner bitmap

Page 80: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o getFramedBitmap

public

static android.graphics.Bitmap getFramedBitmap(android.graphics.B

itmap bitmap)

Gets the framed bitmap.

Parameters:

bitmap - the bitmap

Returns:

the framed bitmap

o getCircularBitmap

public static

final android.graphics.Bitmap getCircularBitmap(android.graphics.

Bitmap bitmap)

Gets the circular bitmap.

Parameters:

bitmap - the bitmap

Returns:

the circular bitmap

o getColorFramedBitmap

public static

final android.graphics.Bitmap getColorFramedBitmap(android.graphi

cs.Bitmap bitmap)

Gets the color framed bitmap.

Parameters:

bitmap - the bitmap

Returns:

Page 81: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

the color framed bitmap

o getPlaceHolderImage o public

static android.graphics.Bitmap getPlaceHolderImage(int res,

o int w,

int h)

Gets the place holder image.

Parameters:

res - the res

w - the w

h - the h

Returns:

the place holder image

o getCompressedBm o public static

final android.graphics.Bitmap getCompressedBm(byte[] b,

o int w,

o int h,

int scaleType)

Gets the compressed bm.

Parameters:

b - the b

w - the w

h - the h

scaleType - the scale type

Returns:

the compressed bm

Page 82: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o getCompressedBm o public static

final android.graphics.Bitmap getCompressedBm(java.io.File file,

o int w,

o int h,

int scaleType)

Gets the compressed bm.

Parameters:

file - the file

w - the w

h - the h

scaleType - the scale type

Returns:

the compressed bm

o getCompressedBm o private

static android.graphics.Bitmap getCompressedBm(android.graphics.B

itmap bm,

o int scaleType,

o int w,

int h)

Gets the compressed bm.

Parameters:

bm - the bm

scaleType - the scale type

w - the w

h - the h

Returns:

the compressed bm

Page 83: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o getOrientationFixedImage o public

static android.graphics.Bitmap getOrientationFixedImage(java.io.F

ile f,

o int w,

o int h,

int scaleType)

Gets the orientation fixed image.

Parameters:

f - the f

w - the w

h - the h

scaleType - the scale type

Returns:

the orientation fixed image

o saveCompressedBm o public static

final void saveCompressedBm(java.lang.String source,

java.lang.String dest)

Save compressed bm.

Parameters:

source - the source

dest - the dest

o saveOrientationFixImage o public static

final void saveOrientationFixImage(java.io.File src,

o java.io.File dest,

o int w,

o int h,

int scaleType)

Save orientation fix image.

Page 84: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

src - the src

dest - the dest

w - the w

h - the h

scaleType - the scale type

com.events.utils

Class ImgTouchEffect

java.lang.Object

o com.events.utils.ImgTouchEffect

All Implemented Interfaces:

android.view.View.OnTouchListener

public class ImgTouchEffect

extends java.lang.Object

implements android.view.View.OnTouchListener

The Class TouchEffect is the implementation of OnTouchListener interface.

You can apply this to views mostly Buttons to provide Touch effect and that

view must have a valid background. The current implementation simply set

Alpha value of View background.

Page 85: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Constructor Detail o ImgTouchEffect

public ImgTouchEffect()

Method Detail o onTouch o public boolean onTouch(android.view.View v,

android.view.MotionEvent event)

Specified by:

onTouch in interface android.view.View.OnTouchListener

com.events.ui

Class LeftNavAdapter

public class LeftNavAdapter

extends android.widget.BaseAdapter

The Adapter class for the ListView displayed in the left navigation drawer.

Field Detail o items

private java.util.ArrayList<Data> items

The items.

o context

private android.content.Context context

Page 86: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The context.

o selected

private int selected

The selected.

Constructor Detail o LeftNavAdapter o public LeftNavAdapter(android.content.Context context,

java.util.ArrayList<Data> items)

Instantiates a new left navigation adapter.

Parameters:

context - the context of activity

items - the array of items to be displayed on ListView

Method Detail o setSelection

public void setSelection(int position)

Setup the current selected position of adapter.

Parameters:

position - the new selection

o getCount

public int getCount()

o getItem

public Data getItem(int arg0)

o getItemId

public long getItemId(int position)

o getView

Page 87: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o public android.view.View getView(int position,

o android.view.View convertView,

android.view.ViewGroup parent)

com.events.utils

Class Log

public class Log

extends java.lang.Object

The Class Log.

Constructor Detail o Log

public Log()

Method Detail o e o public static void e(java.lang.String tag,

java.lang.Object msg)

E.

Parameters:

tag - the tag

msg - the msg

o e

public static void e(java.lang.Object msg)

Page 88: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

E.

Parameters:

msg - the msg

o e o public static void e(java.lang.String tag,

java.lang.Object[] msg)

E.

Parameters:

tag - the tag

msg - the msg

o e

public static void e(java.lang.Object[] msg)

E.

Parameters:

msg - the msg

com.events

Class Login

Page 89: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class Login

extends CustomActivity

The Class Login is the Activity class that is launched when the app require user

to Login to perform next operations like in this current we ask user to Login

before he/she is going to Book Event ticket and once the user is logged in, it

will never ask to loin again for the lifetime of this app.

Constructor Detail o Login

public Login()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomActivity

o doLogin

private void doLogin()

Call the Login API and check user's Login details and based on the API

response, take required action or show error message if any.

o onActivityResult o public void onActivityResult(int requestCode,

o int resultCode,

android.content.Intent data)

Overrides:

Page 90: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onActivityResult in class android.support.v4.app.FragmentActivity

com.events

Class MainActivity

public class MainActivity

extends CustomActivity

The Class MainActivity is the base activity class of the application. This activity

is launched after the Splash and it holds all the Fragments used in the app. It

also creates the Navigation Drawer on left side.

Field Detail o drawerLayout

private android.support.v4.widget.DrawerLayout drawerLayout

The drawer layout.

o drawerLeft

private android.widget.ListView drawerLeft

ListView for left side drawer.

o drawerToggle

private android.support.v4.app.ActionBarDrawerToggle drawerToggle

The drawer toggle.

o adapter

Page 91: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

private LeftNavAdapter adapter

The left navigation list adapter.

o tab

private android.view.View tab

The tab.

o temp

private android.view.View temp

The temp tab view.

Constructor Detail o MainActivity

public MainActivity()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o setupDrawer

private void setupDrawer()

Setup the drawer layout. This method also includes the method calls for

setting up the Left side drawer.

o setupLeftNavDrawer

private void setupLeftNavDrawer()

Setup the left navigation drawer/slider. You can add your logic to load

the contents to be displayed on the left side drawer. You can also setup

the Header and Footer contents of left drawer if you need them.

Page 92: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o getDummyLeftNavItems

private java.util.ArrayList<Data> getDummyLeftNavItems()

This method returns a list of dummy items for left navigation slider. You

can write or replace this method with the actual implementation for list

items.

Returns:

the dummy items

o launchFragment

public void launchFragment(int pos)

This method can be used to attach Fragment on activity view for a

particular tab position. You can customize this method as per your

need.

Parameters:

pos - the position of tab selected.

o setupContainer

private void setupContainer()

Setup the container fragment for drawer layout. The current

implementation of this method simply calls launchFragment method for

tab position 0. You can customize this method as per your need to

display specific content.

o setActionBarTitle

private void setActionBarTitle()

Set the action bar title text.

o onPostCreate

protected void onPostCreate(android.os.Bundle savedInstanceState)

Page 93: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Overrides:

onPostCreate in class android.app.Activity

o onConfigurationChanged

public void onConfigurationChanged(android.content.res.Configurat

ion newConfig)

Specified by:

onConfigurationChanged in interface android.content.ComponentCallbacks

Overrides:

onConfigurationChanged in class android.support.v4.app.FragmentActivity

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class CustomActivity

o onKeyDown o public boolean onKeyDown(int keyCode,

android.view.KeyEvent event)

Specified by:

onKeyDown in interface android.view.KeyEvent.Callback

Overrides:

onKeyDown in class android.support.v4.app.FragmentActivity

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomActivity

Page 94: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o onDestroy

protected void onDestroy()

Overrides:

onDestroy in class android.support.v4.app.FragmentActivity

o onActivityResult o public void onActivityResult(int requestCode,

o int resultCode,

android.content.Intent data)

Overrides:

onActivityResult in class android.support.v4.app.FragmentActivity

com.events

Class MapViewActivity

public class MapViewActivity

extends CustomActivity

The MapViewActivity is the activity class that shows Map fragment. This

activity is only created to show Back button on ActionBar.

Constructor Detail o MapViewActivity

public MapViewActivity()

Method Detail o onCreate

Page 95: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o addFragment

private void addFragment()

Attach the appropriate MapViewer fragment with activity.

com.events.ui

Class MapViewer

public class MapViewer

extends CustomFragment

The Class MapViewer is the Fragment class that is launched when the user

clicks on Map option in Left navigation drawer or when user tap on the Map

icon in action bar. It simply shows a Map View with a few dummy location

markers on map. You can customize this class to load and display actual

locations on map.

Field Detail o mMapView

private com.google.android.gms.maps.MapView mMapView

The map view.

Page 96: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o mMap

private com.google.android.gms.maps.GoogleMap mMap

The Google map.

Constructor Detail o MapViewer

public MapViewer()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o onPause

public void onPause()

Overrides:

onPause in class android.support.v4.app.Fragment

o onDestroy

public void onDestroy()

Overrides:

onDestroy in class android.support.v4.app.Fragment

o onResume

public void onResume()

Overrides:

onResume in class android.support.v4.app.Fragment

o setupMap o private void setupMap(android.view.View v,

android.os.Bundle savedInstanceState)

Page 97: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Setup and initialize the Google map view.

Parameters:

v - the root view

savedInstanceState - the saved instance state

o setupMarker

private void setupMarker()

This method simply place a few dummy location markers on Map View.

You can write your own logic for loading the locations and placing the

marker for each location as per your need.

o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,

android.view.MenuInflater inflater)

Overrides:

onCreateOptionsMenu in class android.support.v4.app.Fragment

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class android.support.v4.app.Fragment

com.events.ui

Class More

Page 98: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

public class More

extends CustomFragment

The Class More is the Fragment class that is launched when the user clicks on

More option in Left navigation drawer and it simply shows a few options for

like Help, Privacy, Account, About etc. You can customize this to display actual

contents.

Constructor Detail o More

public More()

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomFragment

Page 99: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events

Class MoreDetail

public class MoreDetail

extends CustomActivity

The Class MoreDetail is the Activity class that is launched when the user clicks

on any options in More screen and this will simply show TextView like for Help

Center, it will show Help center text.

Constructor Detail o MoreDetail

public MoreDetail()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class CustomActivity

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomActivity

Page 100: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.ui

Class MyTickets

public class MyTickets

extends PagingFragment

The Class MyTickets is the Fragment class that is launched when the user clicks

on My Tickets tab in MyProgram section and It simply shows a dummy list of

user's tickets . You can customize this class to display actual ticket listing.

o Nested Class Summary

Nested Classes

Modifier and Type Class and Description

private class MyTickets.TicketAdapter

The Class TicketAdapter is the adapter class for ticket ListView.

Field Detail o tList

private final java.util.ArrayList<Event> tList

The ticket list.

Constructor Detail o MyTickets

public MyTickets()

Page 101: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o setTicketList

private void setTicketList(android.view.View v)

Setup and initialize the ticket list view.

Parameters:

v - the root view

o loadTicketList

private void loadTicketList()

Load a dummy list of tickets. You need to write your own logic to load

actual list of tickets.

o loadNextPage

protected void loadNextPage()

Description copied from class: PagingFragment

Load next page.

Specified by:

loadNextPage in class PagingFragment

Page 102: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.custom

Class PagingFragment

Direct Known Subclasses:

MyTickets, Programs

public abstract class PagingFragment

extends CustomFragment

implements android.widget.AbsListView.OnScrollListener

The Class PagingFragment can be extended by any fragment who includes a

ListView which require to load contents page by page.

Field Detail o page

protected int page

The page.

o isRunning

private boolean isRunning

The is running.

o hasMore

private boolean hasMore

The has more.

o total

Page 103: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

private int total

The total.

o footer

protected android.view.View footer

The footer.

o adapter

protected android.widget.BaseAdapter adapter

The adapter.

o list

protected android.widget.ListView list

The list.

Constructor Detail o PagingFragment

public PagingFragment()

Method Detail o initPagingList o protected void initPagingList(android.widget.ListView v,

android.widget.BaseAdapter adp)

Inits the paging list.

Parameters:

v - the v

adp - the adp

o reset

protected void reset()

Reset.

Page 104: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o onStartLoading

protected void onStartLoading()

On start loading.

o onFinishLoading

protected void onFinishLoading(int count)

On finish loading.

Parameters:

count - the count

o onScroll o public void onScroll(android.widget.AbsListView view,

o int firstVisibleItem,

o int visibleItemCount,

int totalItemCount)

Specified by:

onScroll in interface android.widget.AbsListView.OnScrollListener

o onScrollStateChanged o public void onScrollStateChanged(android.widget.AbsListView view,

int scrollState)

Specified by:

onScrollStateChanged in

interface android.widget.AbsListView.OnScrollListener

o loadNextPage

protected abstract void loadNextPage()

Load next page.

Page 105: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.ui

Class Programs

public class Programs

extends PagingFragment

The Class Programs is the Fragment class that is launched when the user clicks

on Programs or on MyPrograms option in Left navigation drawer and this is

also used as a default fragment for MainActivity. It simply shows a dummy list

of Events/Programs. . You can customize this class to display actual Feed

listing.

o Nested Class Summary

Nested Classes

Modifier and Type Class and Description

private class Programs.ProgramAdapter

The Class ProgramAdapter is the adapter class for Feed ListView.

Field Detail o pList

private final java.util.ArrayList<Event> pList

The Programs list.

Constructor Detail o Programs

public Programs()

Page 106: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Method Detail o onCreateView o public android.view.View onCreateView(android.view.LayoutInflater

inflater,

o android.view.ViewGroup container,

android.os.Bundle savedInstanceState)

Overrides:

onCreateView in class CustomFragment

o setProgramList

private void setProgramList(android.view.View v)

Setup and initialize the Program list view.

Parameters:

v - the root view

o loadEventList

private void loadEventList()

This method currently loads a dummy list of Recipes. You can write the

actual implementation of loading Recipes.

o loadNextPage

protected void loadNextPage()

Description copied from class: PagingFragment

Load next page.

Specified by:

loadNextPage in class PagingFragment

o onCreateOptionsMenu o public void onCreateOptionsMenu(android.view.Menu menu,

android.view.MenuInflater inflater)

Overrides:

Page 107: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onCreateOptionsMenu in class android.support.v4.app.Fragment

o onOptionsItemSelected

public boolean onOptionsItemSelected(android.view.MenuItem item)

Overrides:

onOptionsItemSelected in class android.support.v4.app.Fragment

com.events

Class Register

public class Register

extends CustomActivity

The Class Register is the Activity class that is launched when the user clicks on

Register button in Login screen and it allow user to register him self as a new

user of this app.

Constructor Detail o Register

public Register()

Method Detail o onCreate

protected void onCreate(android.os.Bundle savedInstanceState)

Overrides:

Page 108: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

onCreate in class CustomActivity

o onClick

public void onClick(android.view.View v)

Specified by:

onClick in interface android.view.View.OnClickListener

Overrides:

onClick in class CustomActivity

o doRegister

private void doRegister()

Call the Register API and check user's Login details and based on the API

response, take required action or show error message if any.

com.events

Class SplashScreen

public class SplashScreen

extends android.app.Activity

The Class SplashScreen will launched at the start of the application. It will be

displayed for 3 seconds and than finished automatically and it will also start the

next activity of app.

Field Detail

Page 109: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o isRunning

private boolean isRunning

Check if the app is running.

Constructor Detail o SplashScreen

public SplashScreen()

Method Detail o onCreate

public void onCreate(android.os.Bundle savedInstanceState)

Overrides:

onCreate in class android.app.Activity

o startSplash

private void startSplash()

Starts the count down timer for 3-seconds. It simply sleeps the thread

for 3-seconds.

o doFinish

private void doFinish()

If the app is still running than this method will start the MainActivity

activity and finish the Splash.

o onKeyDown o public boolean onKeyDown(int keyCode,

android.view.KeyEvent event)

Specified by:

onKeyDown in interface android.view.KeyEvent.Callback

Overrides:

onKeyDown in class android.app.Activity

Page 110: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.utils

Class StaticData

public class StaticData

extends java.lang.Object

The Class StaticData.

Field Detail o appContext

public static android.content.Context appContext

The app context.

o res

public static android.content.res.Resources res

The res.

o pref

public static android.content.SharedPreferences pref

The pref.

o density

public static float density

The density.

Page 111: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o width

public static int width

The width.

o height

public static int height

The height.

o screenSize

public static int screenSize

The screen size.

o appVersion

public static java.lang.String appVersion

The app version.

Constructor Detail o StaticData

private StaticData()

Instantiates a new static data.

Method Detail o init

public static void init(android.content.Context ctx)

Inits the.

Parameters:

ctx - the ctx

o getDIP

public static int getDIP(int val)

Page 112: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Gets the dip.

Parameters:

val - the val

Returns:

the dip

o getUDID

public static java.lang.String getUDID()

Gets the udid.

Returns:

the udid

o getErrorMessage

public static int getErrorMessage()

Gets the error message.

Returns:

the error message

o clear

public static void clear()

Clear.

o clearCache

private static void clearCache()

Clear cache.

o deleteDir

Page 113: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

private static void deleteDir(java.io.File dir)

Delete dir.

Parameters:

dir - the dir

com.events.model

Class Status

public class Status

extends java.lang.Object

implements java.io.Serializable

The Class Status.

Field Detail o serialVersionUID

private static final long serialVersionUID

The Constant serialVersionUID.

See Also:

Constant Field Values

o success

private boolean success

Page 114: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The success.

o message

private java.lang.String message

The message.

o data

private java.lang.String data

The data.

Constructor Detail o Status

public Status()

Instantiates a new status.

o Status

public Status(org.json.JSONObject obj)

Instantiates a new status.

Parameters:

obj - the obj

o Status o public Status(org.json.JSONObject obj,

java.lang.String data)

Instantiates a new status.

Parameters:

obj - the obj

data - the data

o Status

Page 115: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o public Status(java.lang.String res,

java.lang.String data)

Instantiates a new status.

Parameters:

res - the res

data - the data

o Status

public Status(java.lang.String res)

Instantiates a new status.

Parameters:

res - the res

Method Detail o parseJSON o private void parseJSON(org.json.JSONObject obj,

java.lang.String data)

Parses the json.

Parameters:

obj - the obj

data - the data

o isSuccess

public boolean isSuccess()

Checks if is success.

Returns:

true, if is success

Page 116: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o setSuccess

public void setSuccess(boolean success)

Sets the success.

Parameters:

success - the new success

o getMessage

public java.lang.String getMessage()

Gets the message.

Returns:

the message

o setMessage

public void setMessage(java.lang.String message)

Sets the message.

Parameters:

message - the new message

o getData

public java.lang.String getData()

Gets the data.

Returns:

the data

o setData

public void setData(java.lang.String data)

Page 117: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Sets the data.

Parameters:

data - the new data

com.events.utils

Class TouchEffect

public class TouchEffect

extends java.lang.Object

implements android.view.View.OnTouchListener

The Class TouchEffect is the implementation of OnTouchListener interface.

You can apply this to views mostly Buttons to provide Touch effect and that

view must have a valid background. The current implementation simply set

Alpha value of View background.

Constructor Detail o TouchEffect

public TouchEffect()

Method Detail o onTouch o public boolean onTouch(android.view.View v,

android.view.MotionEvent event)

Specified by:

onTouch in interface android.view.View.OnTouchListener

Page 118: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.utils

Class Utils

public class Utils

extends java.lang.Object

The Class Utils.

Constructor Detail o Utils

public Utils()

Method Detail o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o java.lang.String msg,

o java.lang.String btn1,

o java.lang.String btn2,

o

android.content.DialogInterface.OnClickListener listener1,

android.content.DialogInterface.OnClickListener listener2)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

btn1 - the btn1

Page 119: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

btn2 - the btn2

listener1 - the listener1

listener2 - the listener2

Returns:

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o int msg,

o int btn1,

o int btn2,

o

android.content.DialogInterface.OnClickListener listener1,

android.content.DialogInterface.OnClickListener listener2)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

btn1 - the btn1

btn2 - the btn2

listener1 - the listener1

listener2 - the listener2

Returns:

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o java.lang.String msg,

Page 120: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o java.lang.String btn1,

o java.lang.String btn2,

android.content.DialogInterface.OnClickListener listener)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

btn1 - the btn1

btn2 - the btn2

listener - the listener

Returns:

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o int msg,

o int btn1,

o int btn2,

android.content.DialogInterface.OnClickListener listener)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

btn1 - the btn1

btn2 - the btn2

listener - the listener

Page 121: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Returns:

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o java.lang.String msg,

android.content.DialogInterface.OnClickListener listener)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

listener - the listener

Returns:

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

o int msg,

android.content.DialogInterface.OnClickListener listener)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

listener - the listener

Returns:

Page 122: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

the alert dialog

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

java.lang.String msg)

Show dialog.

Parameters:

ctx - the ctx

msg - the msg

Returns:

the alert dialog

o showDialog o public static void showDialog(android.content.Context ctx,

o java.lang.String title,

java.lang.String msg)

Show dialog.

Parameters:

ctx - the ctx

title - the title

msg - the msg

o showDialog o public

static android.app.AlertDialog showDialog(android.content.Context

ctx,

int msg)

Show dialog.

Parameters:

Page 123: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

ctx - the ctx

msg - the msg

Returns:

the alert dialog

o showDialog o public static void showDialog(android.content.Context ctx,

o int title,

o int msg,

android.content.DialogInterface.OnClickListener listener)

Show dialog.

Parameters:

ctx - the ctx

title - the title

msg - the msg

listener - the listener

o isOnline

public static final boolean isOnline()

Checks if is online.

Returns:

true, if is online

o isOnline

public static final boolean isOnline(android.content.Context ctx)

Checks if is online.

Parameters:

Page 124: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

ctx - the ctx

Returns:

true, if is online

o isValidEmail

public static boolean isValidEmail(java.lang.String email)

Checks if is valid email.

Parameters:

email - the email

Returns:

true, if is valid email

o isValidPhoneNumber

public static boolean isValidPhoneNumber(java.lang.String number)

Checks if is valid phone number.

Parameters:

number - the number

Returns:

true, if is valid phone number

o isNumeric

public static boolean isNumeric(java.lang.String number)

Checks if is numeric.

Parameters:

number - the number

Page 125: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Returns:

true, if is numeric

o hideKeyboard

public static final void hideKeyboard(android.app.Activity ctx)

Hide keyboard.

Parameters:

ctx - the ctx

o hideKeyboard o public static final void hideKeyboard(android.app.Activity ctx,

android.view.View v)

Hide keyboard.

Parameters:

ctx - the ctx

v - the v

o showKeyboard o public static final void showKeyboard(android.app.Activity ctx,

android.view.View v)

Show keyboard.

Parameters:

ctx - the ctx

v - the v

o makeCall o public static final void makeCall(android.app.Activity act,

java.lang.String number)

Make call.

Page 126: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

act - the act

number - the number

o deSerialiseObj

public static final java.lang.Object deSerialiseObj(byte[] obj)

De serialise obj.

Parameters:

obj - the obj

Returns:

the object

o serialiseObj

public static final byte[] serialiseObj(java.io.Serializable obj)

Serialise obj.

Parameters:

obj - the obj

Returns:

the byte[]

o copyFile o public static void copyFile(java.io.File src,

java.io.File dst)

Copy file.

Parameters:

src - the src

Page 127: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

dst - the dst

o createNoMediaFile

public static void createNoMediaFile(java.io.File dir)

Creates the no media file.

Parameters:

dir - the dir

o getMD5String

public static java.lang.String getMD5String(java.lang.String in)

Gets the m d5 string.

Parameters:

in - the in

Returns:

the m d5 string

o changeLocale o public static void changeLocale(android.app.Activity act,

java.util.Locale locale)

Change locale.

Parameters:

act - the act

locale - the locale

o getFormattedCount

public static java.lang.String getFormattedCount(int count)

Gets the formatted count.

Page 128: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

count - the count

Returns:

the formatted count

o getBase64ImageString

public

static java.lang.String getBase64ImageString(java.lang.String fil

e)

Gets the base64 image string.

Parameters:

file - the file

Returns:

the base64 image string

o getStringFromAsset

public

static java.lang.String getStringFromAsset(java.lang.String path)

Gets the string from asset.

Parameters:

path - the path

Returns:

the string from asset

o parseDrawableId

public static int parseDrawableId(java.lang.String str)

Parses the drawable id.

Page 129: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Parameters:

str - the str

Returns:

the int

com.events.web

Class WebAccess

Direct Known Subclasses: WebHelper

public class WebAccess

extends java.lang.Object

The Class WebAccess.

Field Detail o BASE_URL

public static java.lang.String BASE_URL

The base url.

o PAGING

protected static final java.lang.String PAGING

Page 130: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

The Constant PAGING.

See Also:

Constant Field Values

o FEED_URL

protected static final java.lang.String FEED_URL

The Constant FEED_URL.

See Also:

Constant Field Values

o EVENT_LIST_URL

protected static final java.lang.String EVENT_LIST_URL

The Constant EVENT_LIST_URL.

See Also:

Constant Field Values

o EVENT_BY_MONTH_URL

protected static final java.lang.String EVENT_BY_MONTH_URL

The Constant EVENT_BY_MONTH_URL.

See Also:

Constant Field Values

o CHECK_BOOK_URL

protected static final java.lang.String CHECK_BOOK_URL

The Constant CHECK_BOOK_URL.

See Also:

Page 131: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Constant Field Values

o LOGIN_URL

protected static final java.lang.String LOGIN_URL

The Constant LOGIN_URL.

See Also:

Constant Field Values

o REGISTER_URL

protected static final java.lang.String REGISTER_URL

The Constant REGISTER_URL.

See Also:

Constant Field Values

o BOOK_TKT_URL

protected static final java.lang.String BOOK_TKT_URL

The Constant BOOK_TKT_URL.

See Also:

Constant Field Values

o TKT_LIST_URL

protected static final java.lang.String TKT_LIST_URL

The Constant TKT_LIST_URL.

See Also:

Constant Field Values

Constructor Detail

Page 132: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o WebAccess

public WebAccess()

Method Detail o executePostRequest o protected

static java.lang.String executePostRequest(java.lang.String restU

rl,

o

java.util.ArrayList<org.apache.http.NameValuePair> param,

boolean save)

Execute request.

Parameters:

restUrl - the rest url

param - the param

save - the save

Returns:

the input stream

o executeGetRequest o protected

static java.lang.String executeGetRequest(java.lang.String restUr

l,

boolean save)

Execute get request.

Parameters:

restUrl - the rest url

save - the save

Returns:

the string

o getPageParams

Page 133: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o protected

static java.lang.String getPageParams(java.lang.String url,

o int page,

int size)

Gets the page params.

Parameters:

url - the url

page - the page

size - the size

Returns:

the page params

o getUserParams

protected

static java.util.ArrayList<org.apache.http.NameValuePair> getUser

Params()

Gets the user params.

Returns:

the user params

o saveToFile o private static void saveToFile(java.lang.String restUrl,

o

java.util.ArrayList<org.apache.http.NameValuePair> param,

java.lang.String res)

Save to file.

Parameters:

restUrl - the rest url

param - the param

Page 134: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

res - the res

o loadFromFile o private

static java.lang.String loadFromFile(java.lang.String restUrl,

java.util.ArrayList<org.apache.http.NameValuePair> param)

Load from file.

Parameters:

restUrl - the rest url

param - the param

Returns:

the string

o getFile o private static

final java.io.File getFile(java.lang.String restUrl,

o

java.util.ArrayList<org.apache.http.NameValuePair> param)

throws java.io.IOException

Gets the file.

Parameters:

restUrl - the rest url

param - the param

Returns:

the file

Throws:

java.io.IOException - Signals that an I/O exception has occurred.

Page 135: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

com.events.web

Class WebHelper

public class WebHelper

extends WebAccess

The Class WebHelper class holds all the methods that communicate with

server API and parses the results in required Java Bean classes.

Constructor Detail o WebHelper

public WebHelper()

Method Detail o getEvents o public static java.util.ArrayList<Event> getEvents(int page,

int pageSize)

Gets the events.

Parameters:

page - the page

pageSize - the page size

Returns:

the events

o parseEvents

Page 136: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

o private

static java.util.ArrayList<Event> parseEvents(java.lang.String re

s)

throws

java.lang.Exception

Parses the events.

Parameters:

res - the res

Returns:

the array list

Throws:

java.lang.Exception - the exception

o parseEvent o private static Event parseEvent(org.json.JSONObject js)

throws java.lang.Exception

Parses the event.

Parameters:

js - the js

Returns:

the event

Throws:

java.lang.Exception - the exception

o parseDate o private static long parseDate(boolean tw,

java.lang.String str)

Parses the date.

Parameters:

Page 137: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

tw - the tw

str - the str

Returns:

the long

o getFeedList

public static java.util.ArrayList<Feed> getFeedList()

Gets the feed list.

Returns:

the feed list

o getEventsByMonth o public

static java.util.ArrayList<Event> getEventsByMonth(java.lang.Stri

ng month,

java.lang.String year)

Gets the events by month.

Parameters:

month - the month

year - the year

Returns:

the events by month

o isBooked

public static boolean isBooked(Event e)

Checks if is booked.

Parameters:

Page 138: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

e - the e

Returns:

true, if is booked

o doLogin o public static Status doLogin(java.lang.String email,

java.lang.String pwd)

Do login.

Parameters:

email - the email

pwd - the pwd

Returns:

the status

o doRegister o public static Status doRegister(java.lang.String name,

o java.lang.String email,

java.lang.String pwd)

Do register.

Parameters:

name - the name

email - the email

pwd - the pwd

Returns:

the status

o bookTkt o public static Status bookTkt(java.lang.String event_id,

o java.lang.String space,

java.lang.String comment)

Page 139: Events Android documentation - Amazon Web Servicesmyappsdoc.myapptemplates.com.s3-us-west-2.amazonaws.com/Eve… · SQL file events_db.sql provided to you and it will auto populate

Book tkt.

Parameters:

event_id - the event_id

space - the space

comment - the comment

Returns:

the status

o getBookedEvents o public

static java.util.ArrayList<Event> getBookedEvents(int page,

int pageSize)

Gets the booked events.

Parameters:

page - the page

pageSize - the page size

Returns:

the booked events