Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Building Hybrid Android Apps with Java and JavaScript
Building Hybrid Android Apps with Java and JavaScript
Nizamettin Gok
Nitin Khanna
Preface
Conventions Used in This Book
Tip
Warning
Using Code Examples
SafariĀ® Books Online
How to Contact Us
Acknowledgments
Nizamettin Gok
Nitin Khanna
About the Technical Reviewer
Dedication
Special Upgrade Offer
Chapter 1. What Is Android?
Android Applications
What Is a Hybrid Application?
Categories of Applications
Note
Key Characteristics of Hybrid Apps
Note
Note
Why Developing Hybrid Apps Makes Sense
Note
Hybrid Application Architecture
How Do Hybrid Apps Work on the Android Platform?
Chapter 2. Setting Up Your Android Development Environment
Note
Note
Installing Eclipse on Mac OS X
Installing Android Development Tools
Note
Creating Your First Hybrid Android Project Using Eclipse IDE
Android Development Using the Command Line
Setting PATH Environment Variables
What Is ADB (Android Debug Bridge)?
Connecting an Android Device to the Development Host
Note
Connecting to an Android Device Over WiFi
Using Apache Ant to Automate Building Android Applications
Note
Understanding the Android Build Process
Resource Precompilation
Service Interface Precompilation
Java Compilation
DEX Generation
Resource Packaging
Creation of the APK File
Alignment
CSS Preprocessors
Tip
Installing SASS
Tip
Tip
Integrating SASS into the Android Command-Line Build System
Note
JSLint Framework and Strict Coding Conventions
Process HTML Templates
Minifying CSS and JavaScript Files Using YUI Compressor
Using Safari and Chrome Browsers for Faster JavaScript Debugging and UI Changes
Chapter 3. Android Fundamentals
Android Application Architecture
Key Android Components
Dalvik Virtual Machine (DVM)
View
Activity
Fragment
Intent
Services
Content Providers
Broadcast Receiver
Security Model in Android
Resources
String Resources
Layout Resources
Compiled and Uncompiled Android Resources
Assets
Structure of an Android App
Note
Application Manifest
Note
Application Package Name
Note
Application
Tip
Note
Caution
Activity
Intents
Intent Resolution
Intent Filter
Services
Note
Broadcast Receiver
Note
Specifying Compatible Device Configuration
Declaring Needed Device Features
Note
Permissions
SDK Version
Note
Hands-on Coding: Hybrid Hello World! Application
Chapter 4. WebView, WebKit, and WebSettings
The WebView as a Web Browser
Note
So What Is WebKit?
Caution
Requesting Internet Permission from Android Manifest
Instantiating and Accessing the WebView Control
Loading a Web Page
Caution
Note
Loading HTML into WebView
Caution
WebViewClient
WebChromeClient
Loading Local Files into the WebView
Caution
Load Flash Files into the WebView
Reading Files from the res/raw Directory
Triggering JavaScript Functions from the Java Layer
Opening a WebView in Fullscreen Mode
Caution
Enabling a Resize Event in JavaScript While Your Application Is Fullscreen
Binding Java Objects to WebView Using the addJavaScriptInterface() Method
Caution
@JavaScriptInterface Annotations
Security Considerations for Hybrid Applications
HttpOnly Cookies and the Secure Flag
Caution
Domain Whitelisting
Caution
Configuring WebView Settings with WebSettings
Preventing Local Files from Being Loaded in the WebView
Enabling JavaScript
Note
Note
Note
Setting Default Font Size
Zoom Controls
Hardware Acceleration
Warning
Chapter 5. Inter-workings of the JavaScript and Java Layers
Architecture of a Hybrid Application
Calling Java Methods from JavaScript
Synchronous APIs
Asynchronous APIs
Calling JavaScript Methods from Java
Routing Data to the Correct JavaScript Receiver
Deferred Object Pattern
Register Success Callback Using deferred.done()
Register Failure Callback Using deferred.fail()
Register Progress Callback Using deferred.progress()
Simpler Callback registration with .then()
Synchronizing Multiple Asynchronous Events with $.when()
Resolve a Deferred Object
Reject a Deferred Object
Use of Promise
Use of deferred.progress()
Cache Manager for Handling Multiple Deferred Objects
Thread Safety
Chapter 6. HTML Architecture for Hybrid Applications
Architecture of a Web Application
Single Page Applications (SPA)
Key Design Considerations for Single Page Applications
The Libraries and Frameworks for Your Hybrid Apps
Backbone.js for MVC Framework
Underscore.js for Utility Support
iScroll.js for scrolling
iScroll Caveats
jQuery.js for JavaScript application
Preload Images Within the CSS Files
Note
CSS Reset Avoids Browser Inconsistencies
Your Home index.html
Caution
Viewport Meta Tag
Viewport Width
Viewport Scaling with the Content Attribute
Responsive Design and Media Queries
EM or Percent (%) unit for scalable interface
Caution
CSS3 Introduces rem Unit
Opacity or RGBA: What Is the Difference?
Event Pooling
Caution
Chapter 7. CSS, DOM, and JavaScript: Optimization Tips and Useful Snippets
Chapter 8. Publishing Apps for Android
Note
Note
Digitally Signing Applications
Protecting Your Application with ProGuard
Google Play
Registering as a Publisher
Developer Console
Note
Uploading an Application
Amazon App Store
Self-Signing and the Amazon App Store
Amazon App Store Sign Up Process
Note
Uploading an Application
Note
Understanding the Application Approval Process
About the Authors
Colophon
Special Upgrade Offer
Building Hybrid Android Apps with Java and JavaScript
Nizamettin Gok
Nitin Khanna
Editor
Simon St. Laurent
← Prev
Back
Next →
← Prev
Back
Next →