Times have changed, and although Java ME still has market share, it is not available on all devices anymore. Java/Java ME developers had no problem moving to BlackBerry or Android but faced challenges on iOS. HTML5 plus PhoneGap apps promised a silver bullet for a “write once, run on all devices” approach via several frameworks, which, in the end, offered painful JavaScript and CSS development. Although GWT offers a great Java-to-JavaScript compiler and debugger, mgwt introduces native-looking widgets on iOS, Android, and even BlackBerry. Also, with the addition of GWT/PhoneGap projects, you can now code native-looking HTML apps that can use native APIs with regular, type-safe, well-known beautiful Java without coding a single line of HTML plus JavaScript. Learn more in this session.
This document discusses various topics related to developing web apps, including HTML5, responsive design, touch events, offline capabilities, and debugging tools. It provides links to resources on HTML5 features like media queries, SVG, web workers, and the page visibility API. It also covers techniques for adapting content like responsive web design, progressive enhancement, and server-side adaptation. Mobile browser stats and popular devices on Douban are mentioned. Frameworks like Bootstrap and tools like Weinre for debugging mobile apps are referenced.
Even though widget libraries for GWT exist, it’s sometimes necessary to create a widget on your own. Widget creation will confront you with challenges like GWT specifics or the way browsers work.
Participants will learn how to compose existing widgets as well as creating new ones based on DOM elements. As it is important to know how browsers behave, topics like DOM API, reflows and event propagation will be explained. But there are also GWT specific aspects, like important interfaces and classes or how to prevent code injection.
L’enjeu du mobile pour le développeur Web, et comment Mozilla va vous aiderTristan Nitot
The document discusses Mozilla's approach to mobile development, which emphasizes building applications using web technologies rather than native apps. It outlines Mozilla's goals of keeping the internet open and accessible across all devices. Key points include:
1. Mozilla is introducing Firefox for Android to bring a desktop-like browsing experience to mobile.
2. The web is positioned as the primary development platform through new HTML5 APIs that allow web apps to behave like native mobile apps.
3. Mozilla is developing technologies like Web APIs and a simple manifest format to help web apps be distributed and installed on mobile devices similar to native apps.
This is an extended version of the talk I gave at Web European Conference in Milan. It covers basic web application security threats and simple tweaks to our applications that help dealing with them.
How to Win at UI Development in the World of Microservices - THAT Conference ...Matt Raible
You've figured out how to split up your backend services into microservices and scale your teams to the moon! But what about the front-end? Are you still building monoliths for your UI? This session will talk about the history of web frameworks, the microservices explosion, and techniques + frameworks for complementing your microservices with micro frontends. It'll include developer stories from folks implementing micro frontends and recommendations for learning more about them.
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Utah JUG...Matt Raible
Microservices are all the rage and being deployed by many Java Hipsters. If you’re working with a large team that needs different release cycles for product components, microservices can be a blessing. If you’re working at your VW Restoration Shop and running its online store with your own software, having five services to manage and deploy can be a real pain.
Share your knowledge and experience about microservices in this informative and code-heavy talk. We’ll use JHipster (a Yeoman generator) to create Angular + Spring Boot apps on separate instances with a unified front-end. I’ll also show you options for securing your API gateway and individual applications using JWT. Heroku, Kubernetes, Docker, ELK, Spring Cloud, Okta; there will be plenty of interesting demos to see!
This document discusses how to create a productive Android development environment using Gradle. It advocates automating the build process and customizing build configurations to reduce errors and improve code quality. Specific conventions covered include using Gradle to manage versioning for multiple APKs, generate configuration files, handle dependencies, and build projects in a consistent manner across different machines. The overall message is that Gradle can help standardize the build process and reduce communication issues compared to less automated approaches.
Top Ten Tips for HTML5/Mobile Web DevelopmentSimon Guest
The document provides top 10 tips and tricks for HTML5/mobile web development. It discusses whether to use a mobile web or hybrid approach and recommends considering features like geolocation and offline support when making that decision. It also covers setting up development and testing environments, using client-side JavaScript for navigation and performance, enabling offline support, choosing UI frameworks, handling maps, non-standard elements, packaging, authentication, and optimizing for performance.
Amp by Google: The Present And Future Of Quick Content DeliveryRaunak Hajela
One of the most important things for a person who’s searching for a piece of information is speed. If they don’t find what they are looking for within a couple of seconds they just close the website and look for another alternative. This might not seem a great problem but when your business is dependent on search traffic and you make money off ads or sell a product, every visitor is worth a lot, you can’t simply afford to lose someone.
To cater this problem Google launched Accelerated Mobile Pages or AMP which is an opensource technology that follows standard HTML markup and optimized JavaScript in order to deliver content at lightning fast speeds. Earlier it was rolled out to News & Media websites but today you can take advantages of this technology on almost any website. This presentation is about how you can easily make your WordPress sites amp optimized, the pros cons and future of this amazing technology.
The document discusses the history and challenges of front-end development. It notes that initially there were many different front-end tools that made selection difficult. Frameworks became popular but could be incompatible and difficult to decouple. It suggests that ES6 and React provide a good foundation for building front-ends, as React code can be written in ES6 and they avoid issues of other frameworks.
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Matt Raible
This document summarizes Matt Raible's presentation on mobile development with Ionic, React Native, and JHipster. It introduces JHipster and how it can be used to generate Spring Boot and Angular/React applications. It then discusses using JHipster to create progressive web apps and how Ignite CLI and Ionic can be used to generate mobile apps from JHipster projects. The presentation concludes by covering JHipster's roadmap and encouraging attendees to try out JHipster.
The document discusses the speed of the modern web. It summarizes key metrics around connection speeds, browser speeds, page weights, adoption of best practices, and page load times based on data from various sources. While some metrics like connection speeds and page load times are improving, pages overall are getting heavier and adoption of best practices is flat. The document advocates watching video growth, developing better performance metrics, promoting best practices more widely, utilizing multiple CPUs, and improving caching.
This document summarizes Steve Souders' presentation on web performance optimization (WPO). It discusses how speed is the most important website feature and outlines techniques to improve performance like optimizing assets, reducing page weight, and leveraging caching. It also covers emerging trends like SPDY and improvements to third-party content. The key takeaways are that WPO matters significantly, new standards are coming, and guarding against slow third-party code.
The document discusses the Windows Azure Toolkit for iOS, which enables iOS applications to access Windows Azure services like Blob Storage, Table Storage, and Queue Storage. It describes some common mobile scenarios that can be enabled by using these services, and outlines how the toolkit addresses the complexity of authenticating from and interacting with iOS applications. It also covers future plans like supporting additional Azure services, an Android version of the toolkit, and providing more code samples and case studies.
The document discusses developing for mobile web. It covers several topics including physical properties of mobile devices, their network usage and power constraints. It also discusses different versions of Gmail optimized for different devices. The document recommends inlining content, deferring non-essential work, and being creative with JavaScript libraries and debugging to improve performance for mobile. It highlights the ability of web technologies to build cross-device applications quickly without native restrictions. The conclusion is that native languages may be better if writing many device plugins, but web technologies can be effective otherwise.
Slides from my talk discussing my experience rebuilding a video player I previously developed in Flash. I gave this talk on March 18th, at the Brisbane Web Design Meetup.
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Matt Raible
JHipster is bad-ass. It's an Apache-licensed open source project that allows you to generate Spring Boot APIs and Angular (or React!) apps. It has a vibrant community and ecosystem with support for deploying to many cloud providers and using the latest DevOps buzzwords, like Docker and K8s.
This session will show you JHipster, why it's cool, and show you how to create an app with it.
* Demo Code: https://github.com/mraible/jhipster6-demo
* JHipster + OIDC: https://developer.okta.com/blog/2019/04/04/java-11-java-12-jhipster-oidc
* JHipster + Microservices: https://developer.okta.com/blog/2019/05/23/java-microservices-spring-cloud-config
* JHipster + Ionic: https://developer.okta.com/blog/2019/06/24/ionic-4-angular-spring-boot-jhipster
* JHipster + React Native: https://developer.okta.com/blog/2018/10/10/react-native-spring-boot-mobile-app
Devoxx UK 2015: How Java EE has changed pattern implementationAlex Theedom
The implementation of traditional design patterns have changed in Java EE 7. By taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. With the use of code examples I will demonstrate how to implement some of the most commonly use design patterns in Java EE. Among the design patterns discuss there will be Factory, Singleton, Observer and Decorator.
Java EE changes design pattern implementation: JavaDays Kiev 2015Alex Theedom
The implementation of traditional design patterns have changed in Java EE 7. By taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. With the use of code examples I will demonstrate how to implement some of the most commonly use design patterns in Java EE. Among the design patterns discuss there will be Factory, Singleton, Observer and Decorator.
Design patterns are not only cool but represent the collective wisdom of many developers. Since the publication of Design Patterns: Elements of Reusable Object-Oriented Software by GoF many new concepts have extended the coverage of these design patterns, and now Java EE provide out of the box implementations of many of the most well known patterns. This talk will show how, by taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. Among the design patterns discuss there will be Singleton, Façade, Observer, Factory, Dependency Injection, Decorator and more.
The implementation of traditional design patterns have changed in Java EE 7. By taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. With the use of code examples I will demonstrate how to implement some of the most commonly use design patterns in Java EE. Among the design patterns discuss there will be Factory, Singleton, Observer and Decorator.
A new term starts and a group of fresh faced year 7's join our after school coders club for teens. I introduce the club and coders and talk about Java programming and java games programming that we will be doing in the sessions.
Design patterns are not only cool but represent the collective wisdom of many developers. Since the publication of Design Patterns: Elements of Reusable Object-Oriented Software by GoF many new concepts have extended the coverage of these design patterns, and now Java EE provides out-of-the box implementations of many of the most well known patterns. This talk will show how, by taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. Among the design patterns discuss there will be Singleton, Façade, Observer, Factory, Dependency Injection, Decorator and more.
Google Web Toolkit (GWT) is a framework for building AJAX-enabled web applications using the Java programming language. GWT allows developers to write client-side code in Java and compile it to optimized JavaScript for fast client-side execution in web browsers. Some key features of GWT include writing, running, testing and debugging the entire web application in Java, catching errors at compile time, and support for internationalization. GWT applications can include rich widget libraries and can access Google and third party web APIs and services. Example applications that can be built with GWT include web-based games, admin panels, mapping applications, and mobile web apps.
SE2016 - Java EE revisits design patterns 2016Alex Theedom
Design patterns are not only cool but represent the collective wisdom of many developers. Since the publication of Design Patterns: Elements of Reusable Object-Oriented Software by GoF many new concepts have extended the coverage of these design patterns, and now Java EE provides out-of-the box implementations of many of the most well known patterns. This talk will show how, by taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. Among the design patterns discuss there will be Singleton, Façade, Observer, Factory, Dependency Injection, Decorator and more.
Design Patterns are not only cool but also bring years of collective wisdom to every level of developers. Since GoF, many books have been written and words shed, as well as many new concepts like Enterprise and Domain Design Patterns extended the coverage the Design Patterns, originally shared by the famous Gang of Four. Unlike the J2EE 1.4 era, Java EE provides easy and out of box implementations of many well known design patterns such as Singleton, Façade, Observer, Factory, Dependency Injection, Decorator, Data Access Patterns, MVC and even more. Many classical design patterns are actually just one annotation away from your project.
Java EE 8: What Servlet 4 and HTTP2 MeanAlex Theedom
The goal of HTTP/2 is to increase the perceived performance of the web browsing experience. This is achieved by multiplexing over TCP and Server Push among other techniques. What implications does this have for developers? How does Servlet 4.0 embrace HTTP/2? We will see, with code examples, what the future of developing with HTTP/2 might look like.
This document discusses how to create mobile apps that feel native using only web technologies. It covers supporting features in Mobile Safari like local storage, CSS3 features, and geolocation. It recommends using web technologies over native due to quicker iteration times. Specific techniques covered include detecting browser type, adding home screen icons, startup images, going full screen, and viewport settings. The document also discusses frameworks like jQuery Mobile but notes native DOM APIs may be sufficient. It covers input features, touch vs click, animations, locking orientation, and performance tips. It acknowledges limitations of Android and webOS and recommends testing on actual devices. Finally, it discusses hybrid mobile frameworks like PhoneGap and Titanium that allow developing for multiple platforms using one code
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersTodd Anglin
HTML5 and CSS3 have arrived. Are you ready to start adopting these technologies in your web projects? Jump start your understanding of the new rich standards and arm yourself with essential techniques for making the most of HTML5 and CSS3 today. In this half-day workshop, you will learn everything you need to know to effectively start leveraging HTML5 and CSS3 in ASP.NET applications. Learn how HTML5 and CSS3 are removing limits from web design. Discover tools and techniques for adopting HTML5 and CSS3 while still supporting older browsers. Leave with the essential knowledge needed to embrace HTML5 and CSS3 in your next ASP.NET project!
The document discusses building mobile web applications using HTML5. It covers topics like HTML5 features that are well supported on mobile browsers like forms, communication, canvas, geolocation, audio and video. It provides examples of using CSS3 for styling, animation and media queries for responsive design. It also discusses utilizing HTML5 APIs for advanced interactions, graphics, offline support, performance and accessing device capabilities.
This document discusses adapting the BoofCV computer vision library for use in GWT applications in the browser. It describes BoofCV and its dependencies like EJML, DDogLeg, and GeoRegression. It details the process of creating GWT adapters for these libraries by adding .gwt.xml files and supersourcing classes to modify them for GWT. Examples are given of using the adapted libraries for interest point detection and association in browser-based applications.
This document discusses adapting the BoofCV computer vision library for use in GWT applications in the browser. It describes BoofCV and its dependencies like EJML, DDogLeg, and GeoRegression. It details the process of creating GWT adapters for these libraries by adding .gwt.xml files and using super-sourcing to modify classes as needed to work in GWT. Examples are given of using the adapted libraries for interest point detection and association in browser-based applications.
This document discusses various techniques for making web applications work offline and with unreliable network connections, including:
- The application cache manifest which allows specifying cached resources to work offline
- Issues with the current manifest specification and potential enhancements
- The window.applicationCache API for caching resources and monitoring cache status
- Detecting online/offline status using the navigator.onLine property
In 3 sentences or less, it summarizes approaches for offline web applications using the application cache manifest, applicationCache API, and navigator.onLine property.
slides of a presentation about cross-platform mobile app development I gave at MobileTechCon 2010 in Mainz (Germany).
Links and additional information on the related blog post at http://HeikoBehrens.net/2010/10/11/cross-platform-app-development-for-iphone-android-co-—-a-comparison-i-presented-at-mobiletechcon-2010/
WebGL is an exciting new HTML5 JavaScript API that allows for rendering real-time 3D graphics in your web browser without a plugin. The technology is gaining fast acceptance and is allowing for truly amazing applications to be built in a native browser environment that were once considered impossible. This new API has it challenges, as it requires an understanding of the low-level Graphics Pipeline and OpengGL ES 2.0. This talk will cover the basics of 3D graphics and the JavaScript API allowing the audience to take away the steps required to create, initialize and run a WebGL application. The talk will also discuss the current state of browser acceptance of WebGL along with existing libraries that can get you up and running with WebGL even faster.
Chris Heilmann gave a presentation arguing that developers should no longer make excuses for not supporting modern web standards and capabilities due to legacy browser support concerns, especially for Internet Explorer. He highlighted statistics showing the declining market share of Internet Explorer and outlined many HTML5 features that are now well-supported across modern browsers. He also discussed Microsoft's commitment to making the new Edge browser compatible with modern standards and continuously updated so that it will matter less for developers to have to support older browser versions.
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
Google Web Toolkit (GWT) is an open source Java framework that allows web developers to create Ajax applications in Java and deploy them as optimized JavaScript. GWT provides tools for building AJAX applications in Java that are compiled into JavaScript for cross-browser compatibility. It handles browser inconsistencies and integrates with existing Java development tools, allowing developers to build and debug Rich Internet Applications using Java instead of JavaScript.
The document provides an overview and lessons learned about developing applications with jQuery Mobile, a framework for building mobile websites and apps. It discusses jQuery Mobile concepts and architecture considerations, including using responsive design principles. It also covers challenges of testing on different devices and addressing device-specific issues like animations. The document provides code snippets and recommendations around areas like loading scripts on every page and leveraging grids.
Google Web Toolkit
Presentation by Assoc.Prof. Dr.Thanachart Numnonda & Asst.Prof. Thanisa Kruawaisayawan, Mini Master of Java Technology KMITL, July 2012
Stefan Judis "Did we(b development) lose the right direction?"Fwdays
Keeping up with the state of web technology is one of the biggest challenges for us developers today. We invent new tools; we define new best practices, everything’s new, always... And we do all that for good user experience! We do all that to build the best possible web – it’s all about our users.
But is it, really? Or do developers like to play with technology secretly loving the new and shiny? Or do we only pretend that it’s about users, and behind closed doors, it’s developer experience that matters to us? Did we lose direction? Is it time for a critical look at the state of the web and the role JavaScript plays in it?
Keynote at Codebits in Portugal, April 2014, explaining the how and why of Firefox OS and how to use it.
Video: https://videos.sapo.pt/ZYQyY57ZlB6lhgIdBzrs
A storm is brewing in the world of mobile applications, with the current model of OS-specific application platforms challenged by a new generation of webapps and widgets using HTML 5 and Device APIs that can work across a far wider range of devices (and not just phones either).
This makes deploying mobile apps in education far simpler and cheaper than the current model of building one-app-per-device in different programming languages; it also makes it possible to develop applications simultaneously for web applications, mobile and desktop. Rather than make a mobile app for your VLE, you can make your VLE out of mobile apps!
Scott Wilson looks at how the standards work, who is adopting them, what you need to do to get started.
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkSt. Petersburg College
Presented June 8, 2012 (Online) at the 'Access by Touch: Delivering Library Services Through Mobile Technologies' conference sponsored by Amigos Library Services.
Description: By the end of 2012, it is expected that more than 80% of the world’s population will have access to a smartphone. Your library users will assume that your library can be accessible from anywhere, at any time, and on any device. Now is the time to be ready! During this webinar, you will:
- learn what a mobile framework is.
- acquire best practices in mobile Web development.
- understand the various technologies (HTML, CSS, JavaScript) and how they work together to build mobile Web apps.
- recognize the differences between native and web apps.
- have an opportunity to continue to work with Chad after the webinar to demonstrate what you learned.
- gain access after the webinar to a free Web server so you can see your mobile Web app live.
The mobile industry is worth over $1.3 trillion annually with over 1.6 billion mobile phones sold in 2011. There is significant hardware fragmentation across the over 680,000 distinct Android devices. Developing apps across the top 4 mobile platforms (iOS, Android, Symbian, Blackberry) reaches only 20% of devices. Mobile platforms differ in their programming languages, development environments, and app stores. No single cross-platform development tool supports all mobile platforms, and mobile web apps face challenges of fragmentation, performance, and monetization.
From Idea to App (or “How we roll at Small Town Heroes”)Bramus Van Damme
Guestlecture I gave to the students ICT at Odisee, explaining the app development process, how we do certain things at Small Town Heroes, and how we implement QA throughout our process.
Similar to Mobile Java with GWT: Still "Write Once, Run Everywhere" (20)
Build an Amazon Polly connector in 15 mins with MuleSoftAlex Theedom
Discover a new way of working with Java that emphasizes innovation over coding. It promotes reuse and a rapid development approach so your teams spend more time innovating. Watch a video of this presentation: http://bit.ly/InnovationOverCoding
Java EE 8 security and JSON binding APIAlex Theedom
Java EE Security and JSON Binding are two new APIs in the Java EE 8 release. The security API provides consistencies between containers with a simple annotation-driven model while JSON Binding completes Java EEs JSON APIs and is a real alternative to Jackson and Gson. In this presentation, I will walk through coding examples from both APIs and by the end of the presentation, you will understand how these two new APIs add to the advancement of the Java EE platform.
JDKIO: Java EE 8 what Servlet 4 and HTTP2 mean to youAlex Theedom
The goal of HTTP/2 is to increase the perceived performance of the web browsing experience. This is achieved by multiplexing over TCP and Server Push among other techniques. What implications does this have for developers? How does Servlet 4.0 embrace HTTP/2? We will see, with code examples, what the future of developing with HTTP/2 might look like.
Java EE 8: What Servlet 4.0 and HTTP2 mean to youAlex Theedom
Servlet 4.0 and HTTP/2 aim to improve web performance. HTTP/2 allows requests and responses to be multiplexed over a single connection, avoiding head-of-line blocking. It also includes header compression and server push. Servlet 4.0 leverages these features, allowing servers to proactively push resources to clients using push builders. Major servers and frameworks are adding support to take advantage of these new capabilities.
Design patterns are not only cool but represent the collective wisdom of many developers. Since the publication of Design Patterns: Elements of Reusable Object-Oriented Software by GoF many new concepts have extended the coverage of these design patterns, and now Java EE provide out of the box implementations of many of the most well known patterns. This talk will show how, by taking advantage of Java EE features such as CDI and the smart use of annotations, traditional design patterns can be implemented in a much cleaner and quicker way. Among the design patterns discuss there will be Singleton, Façade, Observer, Factory, Dependency Injection, Decorator and more.
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youAlex Theedom
The goal of HTTP/2 is to increase the perceived performance of the web browsing experience. This is achieved by multiplexing over TCP and Server Push among other techniques. What implications does this have for developers? How does Servlet 4.0 embrace HTTP/2 and what support is there in JDK 9? We will see, with code examples, what the future of developing with HTTP/2 might look like.
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Mobile Java with GWT: Still "Write Once, Run Everywhere"
1. Mobile Java with GWT
(and alternatives)
Murat Yener & Alex Theedom
@yenerm @alextheedom
2. who (the hell) am I?!?
Java, Flex, GWT, iOS, Android developer
Principle Mentor at Eteration
Eclipse Committer
GDG (GTUG) Istanbul Organizer
Conference Speaker
Mobile App Developer at Intel
4. what (the hell) is this talk
about?!?
The fifth element... The Webview..
HTML5 mobile frameworks
Phonegap
keeping native UX
5. so an HTML5 talk???
Facebook killed HTML5
app.. Zuckerberg said
HTML5 is not there yet!!
try fastbook from sencha
fb.html5isready.com
LinkedIn moved to native!!
so did they just fix it??
8. html5 apps in native shell?? nuts!! this
is too complicated!!
have many of you have web development
experience?
how many of you develop native apps?
how many of you don’t like web
development just because of javascript??
9. but it is slow!!
building games?
3d physics?
image or sound processing?
...
no most of the time we just do this!
10. wait is this really web?
Angry Birds for Chrome (GWT)
Quake on Mobile (requires Chrome Beta for
WebGL) http://mediatojicode.com/q3bsp/
“We started with the existing Jake2 Java port of the Quake II engine,
then used the Google Web Toolkit (along with WebGL, WebSockets,
and a lot of refactoring) to cross-compile it into Javascript. You can see
the results in the video above — we were honestly a bit surprised when
we saw it pushing over 30 frames per second on our laptops (your
mileage may vary)!” from Google Code Blog...
13. GWT 101: java to
javascript?
GWT compiler does the
magic
Optimized high
performance javascript
cross browser
compability (upto ie6)
not really mobile look’n
feel :(
16. so what is mGWT
mobile widget library on gwt
native looking widgets for each platform
maven friendly
mvp ready (maven archetype)
and with gwt-phonegap
17. where to start?
get the source https://code.google.com/p/mgwt
or download the jar
or just use maven
<dependency>
<groupId>com.googlecode.mgwt</groupId>
<artifactId>mgwt</artifactId>
<version>1.1.2</version>
</dependency>
18. Hello World!!
public class MGWTEntryPoint implements EntryPoint {
public void onModuleLoad() {
// set viewport and other settings for mobile
MGWT.applySettings(MGWTSettings.getAppSetting());
// build animation helper and attach it
AnimationHelper animationHelper = new AnimationHelper();
RootPanel.get().add(animationHelper);
// build some UI
LayoutPanel layoutPanel = new LayoutPanel();
Button button = new Button("Hello mgwt");
layoutPanel.add(button);
// animate
animationHelper.goTo(layoutPanel, Animation.SLIDE);
}
}
19. using other libs:
ex. maps..
Google Maps Ver 2.0:
http://code.google.com/p/gwt-google-
apis/
Google Maps Ver 3.0:
http://code.google.com/p/gwt-google-
maps-v3/
No Javascript so far!
<inherits name='com.google.gwt.maps.GoogleMaps' />
20. add a litte spice:
phonegap
geolocation
camera
accelerator
compass
phonebook
file system
even nfc
21. phonegap in action
...
Button button = new Button("Hello mgwt");
button().addTapHandler(new TapHandler() {
@Override
public void onTap(TapEvent event) {
phoneGap.getNotification().alert("Done!!");
}
});
layoutPanel.add(button);
...
22. phonegap, in real action
phoneGap.getGeolocation().watchPosition(geolocationOptions, new MyGeolocationCallback(){
@Override
public void onSuccess(Position position) {
// check accuracy
if (position.getCoordinates().getAccuracy() > 11) {
raceView.getLabel().setText("Error: Accuracy");
}
// geolocation returns mps, multiply with 3.6 to convert to kph
double speed = 3.6 * position.getCoordinates().getSpeed();
if (speed > 0.2) {// if going
raceView.getLabel().setText(speed + "km @" + position.getCoordinates().getAccuracy());
currentLocation = position;
// got the position now can start!
start();
// stop if the threshold is reached
if (isGoing && speed >= 60) {
MgwtAppEntryPoint.phoneGap.getGeolocation().clearWatch(geolocationWatcher);
endLocation = position;
calculate();
}
} else {// if stoped
raceView.getLabel().setText("get ready!!");
isGoing = false;
}
}
@Override
public void onFailure(PositionError error) {
MgwtAppEntryPoint.phoneGap.getNotification().alert("Problem getting location");
}
});
23. even more...
public void onTap(TapEvent event) {
final MCheckBox check = ((MCheckBox) event.getSource());
if (check.getValue()) {
if (TWITTER.equalsIgnoreCase(type))
profileView.getBrowser().showWebPage(Service.BASE_URL + "auth/twitter");
else if (FACEBOOK.equalsIgnoreCase(type))
profileView.getBrowser().showWebPage(Service.BASE_URL + "auth/facebook");
profileView.getBrowser().addLocationChangeHandler(new
ChildBrowserLocationChangedHandler() {
@Override
public void onLocationChanged(ChildBrowserLocationChangedEvent event) {
//Do the login...
}
});
}
}
}
24. going fancy, mvp!
code your UI in the View preferably in xml
via UIBinder
and your logic in the controller (activity)
sound familiar?
easy navigation
lots of boilerplate code
26. connecting to backend
GWT-RPC (yeah, it rocks), but in native package?
JSONP with with RequestBuilder & Autobean
JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
String url = URL.encode(JSON_URL + "/sendData/" + “HelloWorld”);
jsonp.requestObject(url, new AsyncCallback<JavaScriptObject>() {
@Override
public void onFailure(Throwable caught) {
MgwtAppEntryPoint.phoneGap.getNotification().alert(caught.getMessage());
}
@Override
public void onSuccess(JavaScriptObject result) {
JSONObject jsObj = new JSONObject(result);
AutoBean<Score[]> bean = AutoBeanCodex.decode(factory, Score[].class, jsObj.toString());
Score[] scores = bean.as();
scoresCallback.onResponse(scores);
}
});
27. accessing native js
can use any existing javascript
use javascript in type safe way
BUT!! don’t mess touch events!!
AND beware you are not in the safe and
optimized zone anymore!!
33. gwtquery
coming from jQuery, no problem!
public void onModuleLoad() {
//Hide the text and set the width and append an h1 element
$("#text").hide()
.css("width", "400px")
.prepend("<h1>GwtQuery Rocks !</h1>");
//add a click handler on the button
$("button").click(new Function(){
public void f() {
//display the text with effects and animate its background color
$("#text").as(Effects)
.clipDown()
.animate("backgroundColor: 'yellow'", 500)
.delay(1000)
.animate("backgroundColor: '#fff'", 1500);
}
});
}
34. skinning
default themes for
Android (>4.0)
iOS/iOS retina (<7.0)
Blackberry
easy to create yours
https://code.google.com/p/mgwt/wiki/Styling
//append your own css as last thing in the head
MGWTStyle.injectStyleSheet("yourcssfile.css");
36. debugging
first class java debugging in your
IDE
GWT pretty compile and debug
javascript in your browser
use source maps and debug java
in your browser!!
use remote debugging to debug on
mobile devices
37. what about others?
iOS, works like charm.. pretty much native
android, near native experience
blackberry
windows phone
tablets?
desktop??
38. what can i really build?
anything!
but why not going native for games
many widgets.. lists, carousels, forms
dev friendly, you know java? just dive in!
make use of current js
windows phone? seriously?!?
39. </slides>
GDG Istanbul (every 3. or 4. Saturday)
Interested in OSGi? No? ok, i thought so…
and GWT.create at San Francisco
murat@muratyener.com
@yenerm
devchronicles.com