Java everywhere
Java everywhere
Write Once run Anywhere with DukeScript
About the Book
For a long time Java used to be a really good way to create cross-platform applications. Swing, SWT and the frameworks built on top of them gave us a way to deploy our applications to all relevant devices from a single source. The advent of the iPhone changed that. iOS and Android suddenly put up a barrier that wouldn't let us run our applications there. While initially it didn't matter in the enterprise, these platforms have become more and more important.
But Java as you download it isn't a solution any more. DukeScript was invented to solve this problem. With it you can create applications that run on almost any device using the same source code.
This is a book to help you with your project. If you're an absolute DukeScript newbie, that's perfect. The book starts by explaining the core concepts and then immediately jumps to practical exercices. We'll go through our sample applications and inspect how they work. Along the way I'll explain the beasic workings and ideas behind the APIs.
This is a living book. That means that new chapters will be added and content will be updated. Once you've bought the book you'll get these updates for free as long as the book exists. If I find any errors I'll try to fix them in a timely manner, and if you spot any errors, let me know! It also means that if you want more detail on something, or if you miss something, you can tell me in the public issue tracker, and I will try to include it, so together we can make our book even better.
Table of Contents
-
Preface
- About this book
- History
- How it works
-
Getting started!
- Prerequisites
- Developing DukeScript apps with the NetBeans Plugin
- Creating DukeScript apps with Eclipse
- Using Maven to create a DukeScript project
- The Generated Projects
-
Understanding the sample application
- Running the application
- The View
- Binding the View to the Model
- The Model
- Putting it all together
-
Debugging a DukeScript application
- Debugging Java Code
- Visual Debugging
- Debugging on Android Devices
- Debugging on iOS Devices and Emulators
- Debugging JavaScript Code
- Debugging JavaScript with firebug-lite
- Summary
-
Using the Knockout API
- Model, View, ViewModel (MVVM)
- The Model
- The ViewModel
- The View
- Defining the ViewModel
- Summary
-
DukeScript, JSON and the REST
- Creating the project
- Running the application
- The client application
- Code sharing
- Parsing JSON
- Summary
-
Workshop: DukeScript Twitter Client
- Prerequisites
- Set up the project
- DukeScript, JSON and the REST
- Creating the ViewModel
- A model for parsing JSON results
- Create a JSON Endpoint
- Adding Functions for the UI
- Observing Property changes
- Initializing the model
- The View
-
Separating View and ViewModel in practice
- The state of UI Development
- The Setup
- Finding the right Designer
- Working with the design
- The result
- Responsive Design with CSS
- New CSS3 units vh and vw
-
Testing
- Unit Tests
- Test Driven Development means “Test first”
- Is your UI Toolkit Test friendly?
- DukeScript to the rescue
- A little example - Unit Testing a viewmodel
- Unit testing server communication
- @OnReceive with Plain Text
- Type-safe Access to Received JSON Data
- Dealing with JSON Arrays
- Summary
-
Deploying to the App Stores
- Deploying to the Google App store
- Deploying to the Apple Store
- Summary
-
Creating a new API
- Some examples
- HTML5 Canvas
- The @JavaScriptBody Annotation
- The @JavaScriptResource Annotation
- Summary
- Dear Reader,
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them