Logging & Debugging von
M(obile)AF Applikationen
Jürgen Menge
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Jürgen Menge
Sales Consultant
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Einstieg ins Thema
Logging
Debugging
1
2
Agenda
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Debugging
Weitere Informationen
3
4
Bestandteile einer Mobile Plattform
Security
Schutz der Unternehmensdaten
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Integration
Mobile
Strategy
Multiplatform
Entwicklung mobiler
Applikationen
Zugriff auf Daten und
Services
MAINFRAME MAINFRAME MAINFRAME
Oracle Mobile Application Framework
Oracle MAF
Oracle MAF
Write Once, Deploy to Many
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Nutzung vorhandener Kenntnisse
Nutzung vorhandener Kenntnisse
Basierende auf Standards
Basierende auf Standards
Nutzung vorhandener Kenntnisse
Nutzung vorhandener Kenntnisse
Basierend auf Standards
Basierend auf Standards
Oracle MAF
Oracle MAF
Mobile
Device
Server
Server-Generated
Configuration
Service
App. Configuration
Web View
HTML 5, CSS3 & JavaScript Representation
AMX Feature
Local HTML
Feature
Remote URL
Feature
MAF Device Native Container
Components
A
u
th
e
n
tic
a
tio
n
, C
re
d
e
n
tia
l M
a
n
a
g
e
m
e
n
t
&
A
cc
e
ss
C
o
n
tr
o
l
Mobile Application Framework - Architektur
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 6
REST or SOAP
Services
Server-Generated
HTML
Apache Cordova
Plugins & APIs
Java VM
S
Q
Li
te
Client Logic
JDBC
Encrypted Database
APN/GCM Push
Services
Components
Controller
Device Services
A
u
th
e
n
tic
a
tio
n
, C
re
d
e
n
tia
l M
a
n
a
g
e
m
e
n
t
Logging & Debugging von MAF-Applikationen
iOS
Android
Werkzeuge
von
Oracle MAF
JDeveloper
Remote
Debugging
JDeveloper
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 7
Oracle MAF
Plattform-spezifische
Werkzeuge
Android
Monitor
ddms
chrome:/
/inspect
Safari
Web
Inspector
JDeveloper
Logging
Einstieg ins Thema
Logging
Debugging
1
2
Agenda
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Debugging
Weitere Informationen
3
4
Mobile Application Framework – Java Logging
•
System & Error Log (System.out.println, System.err.println)
•
Embedded Logging(Default: com.sun.util.logging.Logger)
•
Konfiguration in der Datei ../META-INF/logging.properties
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 9
Logger.getLogger("oracle.adfmf.application").logp(Level.WARNING,
this.getClass().getName(),
"onTestMessage",
Konfiguration des Logging - logging.properties
Logger Default
Settings
Mobile Application Framework – JavaScript Logging
•
Redirect des Output in Datei durch System.out
<script type="text/javascript" charset="utf-8">
function test_function() { console.log("Message from JavaScript");}
</script>
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 11
•
Verwendung einer Logging Methode im JavaScript
adf.mf.log.Application.logp(adf.mf.log.level.WARNING,
"myClass",
"myMethod",
"My Message");
iOS Logging
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Android Logging – Output Log Datei
•
Datei <AppName>.txt in /sdcard (vorletzte Version als *.txt.bak)
•
Anzeige des Inhalts
•
Lokaler Viewer auf dem Device/Emulator
•
adb logcat (analog tail)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
adb logcat (analog tail)
•
Kopieren der Datei auf den Desktop
•
Media Transfer Protocol (mtp)
Android Logging – Monitor und ddms
•
Debug Monitor (../android-sdk-linux/tools/monitor)
•
Log Messages
Filter, Suchfunktionalität
•
File System Explorer
•
Threads
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Threads
•
Heap usage
•
Network stats
•
Dalvik Debug Monitor Server (../android-sdk-linux/tools/ddms)
DEMONSTRATION
Android Logging
Einstieg ins Thema
Logging
Debugging
1
2
Agenda
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Debugging
Weitere Informationen
3
4
Mobile Application Framework – Remote Debugging
•
Breakpoints im Java Code setzen
•
Debugging in der MAF-Applikation konfigurieren
•
Gerät bzw. Simulator/Emulator vorbereiten
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Gerät bzw. Simulator/Emulator vorbereiten
•
Applikation im Debug Mode auf Gerät
oder Simulator/Emulator deployen
•
Applikation starten
Debugging – Breakpoints setzen
•
Breakpoints in Java-Klassen setzen
•
Lifecycle Methoden
•
Managed Beans
•
POJO Data Control
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
POJO Data Control
•
keine Evaluierung
von EL-Ausdrücken
Konfiguration des Debugging – cvm.properties
•
Konfiguration in der Datei ../META-INF/cvm.properties
•
Aktivieren des Debugging
–
java.debug.enabled=true
–
java.debug.port=8000
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
–
java.debug.port=8000
Debugging – Gerät bzw. Simulator/Emulator
•
Android Emulator
–
Android Virtual Device (AVD) anlegen
und konfigurieren
•
Android Device
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Android Device
–
USB Debugging aktivieren (Developer Options)
–
Installation von Apps aus unbekannten Quellen
erlauben
Debugging – Applikation deployen
•
Deployment Profile auf Debug Mode setzen (Default)
•
Application Properties
•
Deployment => Deployment Profiles
•
evtl. eigenes Profil für Debugging
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
evtl. eigenes Profil für Debugging
anlegen
•
Gerät per USB verbinden
Debugging – Applikation starten und verbinden
•
Applikation auf dem Gerät oder Simulator/Emulator starten
•
Applikation wartet nach dem Start auf den Debug-Prozess
•
Android
•
Port Forwarding
adb -d forward tcp:8000 tcp:8000
/Device
adb -e forward tcp:8000 tcp:8000
/Emulator
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Port Forwarding
•
iOS Simulator
•
Eingehenden Netzwerk-Verbindung akzeptieren
Debugging – Debugger starten
•
Debugger im JDeveloper aufrufen
•
Debugger mit der App verbinden
Debugging – Applikation debuggen
•
Debugger wartet am Breakpoint
•
Step Through | Step to the End
•
Auswertung
•
Breakpoints
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Breakpoints
•
ADF Data
•
Smart Data
•
Data
•
Watches
•
Resume
DEMONSTRATION
Android Debugging
Chrome Remote Debugging (1)
•
Chrome Developer Tools
•
ab Chrome 32 und Android 4.4 für WebView-Applikationen
•
Datei cvm.properties
•
javascript.debug.enabled=true
•
Schritte
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Schritte
•
Chrome aufrufen
•
URL: chrome://inspect
•
Discover USB Devices
•
Port Forwarding ?
Chrome Remote Debugging (2)
•
Elements: DOM Tree, HTML-Elemente, CSS, Event Listener, Viewport
•
Sources: Debugging JavaScript
•
Network: aufgerufene Dateien, Ladezeiten [F5]
•
Audits: Analyse der Seiten beim Laden
•
Console: Kommunikation
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Console: Kommunikation
mit der Anwendung
Safari Remote Debugging (1)
•
Datei cvm.properties
•
javascript.debug.enabled=true
•
Schritte
•
Safari aufrufen
•
Preferences => Advanced
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Preferences => Advanced
=> Show Develop menu ...
•
Start der Applikation
Safari Remote Debugging (2)
•
Resources: DOM Tree, HTML-Elemente
•
Styles: CSS
•
Timelines: aufgerufene Dateien,
Ladezeiten
•
Console: Kommunikation
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
•
Console: Kommunikation
mit der Anwendung
DEMONSTRATION
Remote Debugging
Chrome
Einstieg ins Thema
Logging
Debugging
1
2
Agenda
3
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Debugging
Weitere Informationen
3
4
Weitere Informationen
•
Dokumentation – Mobile Application Framework 2.0.1
https://docs.oracle.com/middleware/mobile201/mobile/develop/maf-debug-test.htm#ADFMF1044
•
Blogs – Debugging ADF Mobile
https://blogs.oracle.com/shay/entry/debugging_adf_mobile_apps_on
https://blogs.oracle.com/mobile/entry/enable_javascript_debugging_on_mac
http://java.dzone.com/articles/debugging-oracle-adf-mobile
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
http://java.dzone.com/articles/debugging-oracle-adf-mobile
•
YouTube Videos – Debugging ADF Mobile
http://www.youtube.com/watch?v=uuQTBSMkmhU
•
Chrome – Developer Tools
https://developer.chrome.com/devtools
Fragen & Antworten
Jürgen Menge
juergen.menge@oracle.com