android training_material ravy ramio
Transcript of android training_material ravy ramio
1. Android and SWS Setting
2. Simple Screen Development 3. SWS API
4. SWS CMS (Menu Management)
5. Mini Project
Android Features
Open Source
Providing Complete Components for Smart Phone Device
Free of Charge
Java-Based Platform
High Performance
1. Android Setting
Setting Development Environment 1. Android Setting
JAVA InstallationJAVA Installation
ADT Bundle ADT Bundle
Eclipse InstallationEclipse Installation Installing ADT to Eclipse
Installing ADT to Eclipse
Installing SDK to Eclipse
Installing SDK to Eclipse
Adding Platform with SDK ManagerAdding Platform
with SDK Manager
Emulator Composition
Device Test
Emulator Composition
Device Test
A B C
① ② ③
JAVA Installation
Install JDK after downloading in http://www.oracle.com/technetwork/java/javase/downloads/index.html
1. Android Setting
ADT Bundle
A. ADT Bundle Installation URL : http://developer.android.com/sdk/index.html -> B STEP
* Checking whether your computer is 32-bit or 64-bit
1. Android Setting
Eclipse Installation
STEP 1 : Installing Eclipse IDE for Java Developers after downloading in URL : http://www.eclipse.org/downloads/ -> STEP2
1. Android Setting
ADT(Android Development Tool) Installation
STEP 2 : Name : ADT Location: https://dl-ssl.google.com/android/eclipse/
1. Android Setting
ADT(Android Development Tool) Installation
• After only checking ‘Developer Tools’ Click on Next > Button• After checking License agreements, click on Finish button. In the installation detail window, click on next
button.
1. Android Setting
STEP 3 : When restarting Eclipse, you can see message of no SDK setting and then SDK installation screen. After clicking NEXT BUTTON, continuing to install. If there is no installation message, please manually install SDK with next slide guide.
Android SDK Installation (Automatic Installation) 1. Android Setting
Android SDK Manual Installation 1. Android Setting
Downloading Android SDK in http://developer.android.com/sdk/index.html
Step A : Please check SDK Location in [Window] > [Preferences]
1. Android SettingAndroid SDK Manual Installation
Android SDK Manager
STEP B : Checking existing platforms in [Window]->[Android SDK Manager]. Supporting installation/deletion of specific platforms. Checking the latest version of Android 4.3(API 18) 2.3.3(API 10), and 가장 아래쪽의 Extras 항목 체크 후 설치 .
1. Android Setting
2.3.3
And
Extras 가
어디있나요 ?
수정수정
Emulator Setting and Usage
STEP 3 : Setting emulator for each devices in [Window] ->[Android Virtual Device Manager] Setting RAM to 700 in memory option for SDCARD addition
1. Android Setting
PROJECT CREATE
프로젝트 생성시 생성되는 폴더 및 파일 입니다 .
“activity_main” 으로 설정된 값 참조
Strings.xml 의 “ hello_world” 값 참조
Folder Description
/src Including java source files The same folder name as package name
/Android<version>
Including Jar files Including basic libraries for target platforms
/res Including resource files xml layout, picture files, String xml, sub-folders for each type
/gen
Including source files auto-generated by ADT Auto-generation (not allowing to modify) including Java package sub-folder and R.java file
/assets Empty folder Used to include mutimedia contents such as video files
AndroidManifest.xml
Including application information such as authority of each application component
Default.properties
Project Setting files (ex, Build Target)
1. Android Sample
이 장과 관련 없는 설명인 것 같습니다 .
수정수정
RUN
Running the application, we select emulators or devices in device chooser screen.
1. Android Sample
Layout 1. Android Sample
Defining view layout
Linearlayout RelativeLayout Frame Layout Table Layout
Button #1
Button #2
Button #3
Button #1
Button #2
Top
Bottom
Button #1
Button #1 Button #2
Button #3 Button #4
2 Columns
2
Rows
Layout Description
Linear Layout -Box model- Similar to java BoxLayout
Relative Layout - Rule-based model- Designing screen with relative position
Frame Layout - One View- Duplicating several views
Table Layout - Grid Model
SampleHelloWorld
POPUP OPEN (Adding source code to NewActivity.java, new_activity.xml)
1. Android Sample
Please check out red color source code.
SampleHelloWorld
WEB OPEN
public void onClick(View v) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://google.com")); startActivity(myIntent);}
Phone calling
public void onClick(View v) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("tel:010-1234-1465")); startActivity(myIntent);}
Opening web site/ phone calling
1. Android Sample
SampleListView2 1. Android Sample
SAMPLE.
Icon #1
- ListView one Item Layout
Text #1
Text #2 Text #3
Source Description
IconTextItem.java - Including listview item data(Icon, Text1, Text2, Text3).
IcontextView.java - Including view information for one specific item of listviews
IconTextListAdapter.java - Connecting Listview to Data (Adaptor class)
DataListView.java - Listview 를 상속하여 만든 DataListView Class
listitem.xml - One Item Layout xml
- Source Page
수정수정
Life Cycle
NEW ACTIVITYNEW ACTIVITY
STOPSTOP
DESTROYDESTROY
RUNRUN
PAUSEPAUSE
1. onCreate()
2. onStart()
3. onResume()
1. onRestart()
2. onStart()
3. onResume()
onPause()
onStop()
onDestory()
onResume()
SWS(Smart Work Station)
SWS Client Toolkit - 클라이언트 개발을 위한 API 및 라이브러리
SWS PUSH - SMART PUSH 솔루션
SWS CMS - SMART APP/MENU 관리 솔루션
SWS MDM - SMART 보안 솔루션
SWS JEX MOBILE - Hybrid 방식의 앱 플랫폼 (PhoneGap Base)
스마트 비즈니스 앱 개발을 위한 종합적인 스마트 솔루션
수정수정
SWS Android Package 1.SWS API
SWS Android Package 1. Common Component
(Commonly used components for app development)- Common parts used for every application development- .biz package for Business-specific domain
2. Specific Components (Screen for each transaction – package
to process real transaction)
SWS Package Structure
com.webcash.sws.comm.conf
Conf.java : including common information for environment setting
such as platform-related options, release or not, test or no, site domain url, gate page address and so on
com.webcash.sws.comm.conf.biz
BizConf.java : including common setting information for business-specific domain
BizPref.java : including menu-related information
conf (Configuration Setting Package)
define (Including common string and constant values)
com.webcash.sws.comm.define
Msg.java : including common messages
com.webcash.sws.comm.conf.biz
BizConst.java : startActivityForResult 로 값을 받을 때 , Request_Code 를 정의한 클래스 .
BizMsg.java : 화면상에 나가는 업무단 메시지를 정의 . 효율적인 업무를 위해 수정 및 추가가 필요함 .
SWS Android Package 1.SWS API
Conf 패키지는 시스템 환경설정 관련이고
Define 패키지는 실제응용시스템 설정 정보를
포함하는건가요 ?
두 패키지에 있는 클래스에 대한 설명이 동일한데
수정 부탁드립니다 .
수정수정
SWS Android Package 1.SWS API
com.webcash.sws.comm.extras
Extras : Defining input parameters between activities
extra (Data processing for Screen Change)
com.webcash.sws.comm.session
Defining common Info objects to process Session information. Session.biz 객체에 담을 정보를 업무단 별로 나눠서 생성 및 관리 .
com.webcash.sws.comm.session.biz
BizSession.java : Including general transaction information such as latest access time, and user information.
InfoAcctNo.java : Session object for withdrawal account in login transaction.
InfoBankCode.java: Session object to manage bank own code number
session (Session Information Processing)
com.webcash.sws.comm.util
BizException.java : Exception handling of message processing in try~catch statement
BizMenu.java : Preprocessing class for CMS menu messages
BizUtil.java: Processing Login, other app link, and app installation or not
Convert.java : Data formatting for account number, credit card number, calendar day, date, day, time and so on
ComUtil.java : Multi-function class for capturing current view, getting phone information, displaying OS information, and so on.
UTIL (Common Utility)
SWS Android Package 1.SWS API
To reuse frequently-used UI components. Adding more classes as needed
com.webcash.sws.comm.ui
Dlgalert.java: class for dialog screen(guide popup) used commonly in screen app section
com.webcash.sws.comm.ui.biz
BizAmounntEditText.java : Entering amount of money
BizMenuBar.java : Menubar of screen bottom.
BizScrollView.java : Controlling screen view and bottom keypad.
BizSpinner.java : Spinner
BizTitleBar.java : Top title bar
BizCalendar.java : Calendar
BizActionSheet.java : ActionSheet
com.webcash.sws.comm.ui.browser
BizBrowser.java : Defining actionCode to communicate WebView web call, web and app each other
UI (UI Component)
SWS Android Package 1.SWS API
com.webcash.sws.comm.tran
BizInterface.java : Encryption/decryption of message transaction.
ComTran.java : keypad, tranMesage Dialog, Http app common part
com.webcash.sws.comm.tx
TxField.java, TxMessage.java, TxRecord.java : Generating JSON files
com.webcash.sws.comm.tx.biz
Package for defining message transaction fields and property values. Each message no has a pair of request part(REQ) and response(RES) part.
Generating message transaction for each message number which allows multiple records.
Tran/tx (Message Processing)
수정수정
MENU MANAGER 1.SWS API
SAMPLE.
samplesamplepublic void returnMenu() {
// Menu success call back function
public void returnMenuAction(String actionCode, JSONObject actionURL) {
//Menu Manager Action callBack function
public void returnMenuError(String errorCode, String errorMessage) {
//MENU SERVICE CALL BACK Function
Sending Messages 1.SWS API
SAMPLE.1. Creating message objects of request and response inheriting TxMessage class for
each message number
Message object includes TXNO member variable for message number.
Generating integer type variable corresponding to fields of message format. (Saving indexes)
Adding variables for each fields by means of addFileld in mLayout
Generating getter/setting methods for each message field
public class TX_MG001_REQ extends TxMessage {
public static final String TXNO = "MG0001"; // message no.
private static int IDX_CUR_APP_VER; // version information
public TX_MG001_REQ(Activity atvt, String txNo) throws Exception {
mTxNo = TXNO;
mLayout = new TxRecord(); // layout to include message field information
// TXField class corresponding to each message field
IDX_CUR_APP_VER = mLayout.addField(new TxField("CUR_APP_VER", " 버젼정보 "));
super.initSendMessage(atvt, txNo); }
/** version information
* @param value
* @throws Exception
*/
public void setCUR_APP_VER(String value) throws JSONException, Exception {
mSendMessage.put(mLayout.getField(IDX_CUR_APP_VER).getId(), value); // sending(requesting)
}
}
samplesample
2. Implementing BizInterface of message interface in each Activity
Calling msgTrSend method overrided by defined message number.
@Override
2 public void onCreate(Bundle savedInstanceState) {
3 super.onCreate(savedInstanceState);
4 setContentView(R.layout.main);
5 mComtran = new ComTran(this); // Creating common class instances for message sending and receiving6
7 // MG0001 Message Sending
8 msgTrSend(TX_MG001_REQ.TXNO);
9 }
SAMPLE.
Processing Message Sending 1.SWS API
3. Implementing msgTrSend and msgTrRecv after sending message.
Branching by message no in overrided msgTrSend method
Setting message field value by creating message instance.
Calling msgTrSend method by creating Comtran class instances.
Implementing message receiver in msgTrRecv called by callback.
/**
03 * Sending message
04 * @param tranCd Message Code
05 */
06 @Override
07 public Boolean msgTrSend(String tranCd) {
08 try {
09 if(TX_MG001_REQ.TXNO.equals(tranCd)) {
10 // Creating message sending instance
11 TX_MG001_REQ reqMsg = new TX_MG001_REQ(this, TX_MG001_REQ.TXNO);
12 reqMsg.setCUR_APP_VER("1.0.0"); // Setting message field value
13 // Sending message
14 mComtran.msgTrSend(TX_MG001_REQ.TXNO, reqMsg.getSendMessage()); }
15 } catch(Exception e) {
16 e.printStackTrace();
17 }
18 return null;
19 }
/**
22 * Receiving message
23 * @param tranCd Message code
24 * @param obj Received content
25 */
26 @Override
27 public void msgTrRecv(String tranCd, Object obj) {
28 try {
29 if(TX_MG001_REQ.TXNO.equals(tranCd)) {
30 // Creating message receiving instance
31 TX_MG0001_RES resMsg = new TX_MG0001_RES(this, obj, TX_MG001_REQ.TXNO);
32 String masterId = resMsg.getMASTERID(); // 필드 값 얻어오기
32 }
33 } catch(Exception e) {
34 e.printStackTrace();
35 }
36 }
SAMPLE.
Processing Message Sending 1.SWS API
UTIL 1.SWS API
BizSpinner1. Writing XML
<com.webcash.sws.comm.ui.biz.bizspinner ….. </com.webcash.sws.comm.ui.biz.bizspinner>
2. Data binding to spinner
BizSpinnerbizSpinner = (BizSpinner)findViewById(R.id.Spinner1);
bizSpinner.addItem(“WooriBank", "0020");
bizSpinner.setItemList();
3. Importing name/code for selected items
BizSpinnerbizSpinner = (BizSpinner)findViewById(R.id.Spinner1);
String str = bizSpinner.getSelectedName();
String str = bizSpinner.getSelectedCode();
5. Implementing BizOnIitemSelected
implements BizItemSelected // Inheriting implementation. bizSpinner.setItemList(0, true); // Setting true for whether listening or not for data binding.
// Implementing BizOnItemSelected
public void BizOnIitemSelected(AdapterView parent, View view, intpos, long id) { g_outAcctNo =mSpnAcctNo.getSelectedCode(); TextViewtvAcnoNm = (TextView)findViewById(R.id.AcnoName); .. mSpnSeqDis.setSelection(0); }
수정수정
UI 1.SWS API
LOG
1. Checking logging or not by depending on release mode
Delete logs after finishing development
Logging in release mode for debugging.
Logging by calling printException method of PrintLog class when you want to log.
Calling Error method of DlgAlert class when you want use popup window.
samplesample
UI
Calendar Calling common calendar with Intent
Pass selected date to parameter of Extra_calendar class
Returning selected date with result@Overridepublic void onClick(View v) { Intent intent = null; switch(v.getId()){
case R.id.btn_RsvDate : // calendar call intent = new Intent(this, BizCalendar.class); Extra_Calendar mExtra_Calendar = new Extra_Calendar(this, getIntent()); mExtra_Calendar.Param.setPickDate(mTranExcDate); // Passing selected date intent.putExtras(mExtra_Calendar.getBundle()); // selected date result
startActivityForResult(intent, BizConst.reqCd.BizCalendar.CALENDAR); break;
} }
@OverridePublic void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if(resultCode != Activity.RESULT_OK ) return; switch(requestCode) { case BizConst.reqCd.BizCalendar.CALENDAR :
// Returning selected date with intent mExtra_Calendar = new Extra_Calendar(this, intent); mTranExcDate = ComDate.formatNoneDelimiter(mExtra_Calendar.Param.getPickDate()); mTvRsvDate =(TextView)findViewById(R.id.tv_RsvDate); mTvRsvDate.setText(Convert.ComDate.formatKorYYmmDD(mTranExcDate)); break;
default : break;
} }
1.SWS API
수정수정
SWS CMS? 1. SWS CMS(Menu Management)
Manageable by each App and OS versionResource management/controlling for dynamic menu change, and property management for each menu
APPAPP Menu Information Update
Menu Information Update JSON DeploymentJSON Deployment
APP Task(Reserved
String, and Source changes)
APP Task(Reserved
String, and Source changes)
Updating new version App ID
Menu Information
Updating new version App ID
Menu Information
New Version
JSON Deployment
New Version
JSON Deployment
New verson
Change
IPHONE
1.0 (SERVICE MENU:3)
1.1 (SERVICE MENU:5)
...
2.0 (SERVICE MENU:10)
IPHONE
1.0 (SERVICE MENU:3)
1.1 (SERVICE MENU:5)
...
2.0 (SERVICE MENU:10)
Android
1.0 (SERVICE MENU:3)
1.1 (SERVICE MENU:4)
...
2.0 (SERVICE MENU:10)
Android
1.0 (SERVICE MENU:3)
1.1 (SERVICE MENU:4)
...
2.0 (SERVICE MENU:10)
Win mobileWin mobile
badabada
etcetc
JSON SAMPLE 1. SWS CMS(Menu Management)
{"_tran_res_data":[{"_menu_info":[{"c_act":" 나중에 이용해 주시기 바랍니다 .", "c_reason":" 서버문제로 잠시 접속하실 수 없습니다 .", "c_available_notice ":"-1", "c_menu_id":"AWG_GATE1", "c_update_act":" 새로운 버전의 비즈웨어가 나왔습니다 . 업데이트를 받으시겠습니까 ?", "c_appstore_url":"http://m.smartoffice365.co.kr/mobile/download/SmartOffice365.apk", "c_server_oid":"", "_last_modified_date":"20131002175435", "c_program_ver":"1.0.4", "c_available_service":"true", "c_menu_title":" 비즈웨어 모바일 ", "c_update_date":"20131002", "c_session_time":"600" }],"_locale":"kr","_master_id":"A_B_G_1"}]}
BIZWARE MENU JSON Common JSON Individual JSON
{"_tran_res_data":[{"c_act":" 나중에 이용해 주시기 바랍니다 .","c_reason":" 서버문제로 잠시 접속하실 수 없습니다 .","c_available_notice ":"-1","_menu_info":[{"_master_id":"A_B_G_1","_locale":"kr","c_quick_drawable":"button_f10100_a","c_grid_drawable":"button_c10100_a","c_menu_grid":"True","c_menu_id":"AWG_MENU1","c_menu_seq":"2","c_quick_default":"False","c_login_level":"1","c_submenu_img":"","c_menu_url":"com.webcash.bizware.ui.bbs.Bbs_MainMenu","c_new_count":"False","c_menu_title":" 게시판 ","c_view_type":"3"},{"c_quick_drawable":"button_f10600_a","c_grid_drawable":"button_c10200_a","c_menu_grid":"True","_menu_info":[{"c_quick_drawable":"","c_grid_drawable":"","c_menu_grid":"False","c_menu_id":"AWG_MENU2_1","c_menu_seq":"5","c_login_level":"1","c_quick_default":"False","c_submenu_img":"e07300_a","c_menu_url":"/mail0001_02.act","c_new_count":"","c_menu_title":" 받은메일함 ","c_view_type":"1"},
Common Information Management 1. SWS CMS(Menu Management)
Subsidiary Company Management
Defining subsidiary for APPs
Language management
Defining which language the App supports
Common Information Management 1. SWS CMS(Menu Management)
Reserved String Management
Commonly used properties of Menu (ex. Real, test Url, and so on)
Platform Management
Management by each APP OS
App Management 1. SWS CMS(Menu Management)
Menu Management – Menu Type Management
Can be registered by two types of menus; Common Menu(GATE_MENU : App information menu), Individual Menu (SUB_MENU: business menu )
Menu Management – Menu Property Management
Defining the properties of common menu and business menu
App Management
c_menu_id MENUID used in MM messagec_menu_title Menu name_last_modified_date Latest update date_locale Language_master_id SITEID used in MG messagec_session_time Session time_menu_info Sub-menu information_tran_res_data Response data_platform_id Platform ID 플랫폼 아이디_client_corp_id Subsidiary company ID_browser_id Browser ID_browser_ver Browser version_install_file_value Installed filed versionc_server_oid Data related to certification(??)s_test_server_oids_real_server_oidParentmenuidMENULVL
c_available_service Service available or not
c_available_notice Update or not, Notice
1. SWS CMS(Menu Management)
Menu Management– Menu Property Management( 예약어외 필수값 )
Below reserved keywords are already defined rule.
1. Reserved keywords
2. Reserved keyword of Common Menu (GATE MENU)
App Management 1. SWS CMS(Menu Management)
App Management
All list for app management. Export JSON data for clicking Export.
App
Management
App
ManagementJexframeJexframe
Json File Backup Folder
Json File Backup Folder
File generation in the path of
FileMonitor.ocnf, and separateFiles.pathGetting jex.user.xml file and files of separateFiles.path
Structure of Menu Export System
①② ③
④ ⑤
App Management 1. SWS CMS(Menu Management)
① App registration ② Copying App - Reusing existing App information
③ Version Upgrading of App ④ Managing App installation file
Send Message
Mini-Project 1. MAIN, Board
Send Message Send Message Define java
MG (APP Config)- TX_MG0001_REQ.java- TX_MG0001_RES.java- TX_MG0001_RES_REC1.java
Menu- TX_MM0001_REQ.java- TX_MM0001_RES.java- TX_MM0001_RES_REC1.java
LogIn - TX_MAIN0001_03_REQ.java- TX_MAIN0001_03_RES.java
Board List
- TX_AP0627_REQ.java- TX_AP0627_RES.java- TX_AP0627_RES_REC1.java- TX_AP0627_RES_REC1_REC2.java
Board Sub List(Text List)
- TX_AP0621_REQ.java- TX_AP0621_RES.java- TX_AP0621_RES_REC1.java