Wednesday, July 27, 2016

This Week in Mobile Web Development (#118)

Read this on the Web

Mobile Web Weekly July 27, 2016   #118
Chris Brandrick recommends
Mobile First: Insights From Going Mobile Only — An extensive writeup of what a developer experienced by going ‘mobile only’ for a month, and the best practices he picked up.
Joe Toscano
Holly Schinsky recommends
Add Offline Support to Any Web App — How to add support for offline caching to your apps to provide an instant loading experience.
Wassim Chegham
Holly Schinsky recommends
Mobile Web Navigation Best Practices — An in-depth article on mobile web navigation tips and best practices you can use to provide the best experience for your apps.
Visual Hierarchy Blog
Sponsored
AngularJS Tutorial: Build a Feature Loaded Chat App — Learn to build your own AngularJS chat app with realtime messages and more in no time. View Tutorial.
PubNub

Brian Rinaldi recommends
Responsive Web Design is not Mobile First — Shrinking your desktop site to fit on a phone using RWD techniques, as many companies do, is not an approach that will make mobile users happy.
The Huffington Post
Peter Cooper recommends
Why Marketers Should Care About Mobile Page Speed — New research reveals the factors that cause your mobile site to underperform.
Google
Holly Schinsky recommends
Create A Mobile App From Your Angular 2 Web App with NativeScript — How to take an Angular 2 web app and bring it to mobile using NativeScript.
Nic Raboy
Brian Rinaldi recommends
Use React Native to a Create a Face Recognition App — How to use the Microsoft Face API within React Native.
Wern Ancheta
Holly Schinsky recommends
Real-Time Chat App with OnsenUI and Horizon — Learn how to build a mobile chat app with Onsen UI, RethinkDB and the Horizon open source real-time backend.
Onsen UI
Chris Brandrick recommends
Conversational Interfaces: Where Are We Today? Where Are We Heading? — The current state of conversational interfaces, the challenges they bring and where things are heading.
Cosima Mielke
Holly Schinsky recommends
React App SDK: A New Productivity Tool for Building React Apps — React APP SDK is a new productivity tool for front-end developers building apps with React/Webpack and requires a single dependency with no build configurations.
Konstantin Tarkus
Holly Schinsky recommends
imperiojs Library: To Bridge the Gap Between Mobile and Desktop — A new open-source JavaScript interaction library that allows you to control your laptop browser using your mobile device.
imperiojs
Brian Rinaldi recommends
Fact Checking The Web… or Just Some Reddit Thread About NativeScript — A response to some recent Reddit comments that reflect common misperceptions about NativeScript.
Brad Martin
Brian Rinaldi recommends
Q2 Android WebView Statistics — The latest batch of data from Scientia Mobile shows that well over 60% of Android phones run the latest Chromium WebView.
PPK
Brian Rinaldi recommends
Accessible UI Components for the Web — A look at the four key areas of disability to consider: visual, hearing, mobility and cognition.
Addy Osmani
Holly Schinsky recommends
User Experience Monitoring on Hybrid Applications — How to create a hybrid mobile app and add user experience monitoring to it with Dynatrace.
Bert Van der Heyden
Holly Schinsky recommends
Part 2: Creating a Multiple User App with Ionic 2, PouchDB & CouchDB — Part 2 of a tutorial on how to create an app with PouchDB and CouchDB that supports multiple users and authentication.
Josh Morony
Sponsored
Komodo IDE: The Best IDE for Web and Mobile Developers — Web & mobile devs get all their favorite frameworks, languages, and tools in one cross-platform, polyglot IDE.
ActiveState

Brian Rinaldi recommends
The Progress of Web Apps — An update to an earlier Medium article about PWAs and Windows that reflects more recent information.
Microsoft Edge Team
Holly Schinsky recommends
Bootstrap 2 Ionic — Bootstrap to Ionic is a new tool for easily converting your bootstrap 3 themes to a matching Ionic theme.
Max Lynch
Holly Schinsky recommends
The Best of Google I/O 2016 — A post covering highlights from Google I/O including ServiceWorkers, CSS containment, payment APIs, animation techniques, devtools features and more.
Andrew Betts
Holly Schinsky recommends
Tips and Tricks for Styling Ionic 2 Applications — Specific “tips & tricks” relevant to Ionic 2 development.
Josh Morony
Job listing
Stop Applying to Jobs - Let Companies Come To You — On Hired, engineers typically get 5+ job offers in 1 week. Find that new opportunity you've been craving and get access to 4,000+ companies instantly.
Hired.com

Curated by Brian Rinaldi and Holly Schinsky for Cooper Press.
Cooper Press is located at Office 30, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
Update your email address
or stop receiving MWW here


by via Mobile Web Weekly

Simplest Tags Input Beautifier with JavaScript

Better tags input interaction with JavaScript.

The post Simplest Tags Input Beautifier with JavaScript appeared first on jQuery Rain.


by Admin via jQuery Rain

Create a Custom Plugin in OpenCart 2.1.x.x: Part One

Building a REST API With AWS SimpleDB and Node.js

jQuery floating Menu Plugin

This plugin requires jQuery! floatingMenu is a global-dynamic plugin which means you dont have to worry about dynamically added/created elements. For performance reasons the plugin clears its own initiation events when not visible.

The post jQuery floating Menu Plugin appeared first on jQuery Rain.


by Admin via jQuery Rain

An Introduction to Loopj

Loopj is an Android library for making asynchronous HTTP requests. I like it for its ease of use and simplicity. Created by James Smith, it's also known as "Android Asynchronous HTTP Client", and it's used by companies like Instagram, Pinterest, and many others. It's a good entry point to the world of HTTP libraries, and will help you understand important concepts very easily.

To learn to use this library, we are going to create MovieTrivia, a simple app that connects to a web service to retrieve information about movies or TV shows and displays this information to the user.

1. Setup

To start, create a new Android Studio project, with an empty activity. To include Loopj, copy the dependency from the official website. You can find the dependency under the "Installation and basic usage" section of the website (or just copy the string below). 

The message "Sync Now" will pop up in the upper right-hand corner. Click it so Gradle will download the library and make it available to your project.

Because the app will connect to the internet, we must declare the appropriate permission for the user to authorise. Open your AndroidManifest.xml file and, just before the application tag, write:

Now you are ready to start using Loopj in your app.

2. Implementation

We are going to create the simplest possible user interface: just a TextField to enter a search term, a Button to do the search, and a TextView to show the results. Open activity_mail.xml and add the required UI components as shown below.

Now, as usual, wire up these components in your MainActivity.java.

To keep your code clean and organized, create a separate java class, MyLoopjTask.java, to contain all the Loopj-specific code and operations. You will need two instance variables, one of type RequestParams to build the search details into the URL, and another of type AsyncHttpClient to actually make the HTTP requests. Before going further, check that Android Studio added these necessary imports.

Also create a method that takes the user query as an argument—this is where the actual work will be done.

As you see, you can add all the necessary API request parameters keys with the RequestParams instance (in this case, just the query entered by the user). This version of the get() method returns a JSON object to onSuccess, but there are other variations available to fit your needs. (Use Ctrl+O to see the other versions of this method.)

This is all you need to do to implement a Loopj client to make HTTP calls to a web service. In our case, we want to send our request when the user clicks the "Search" button. So, back in MainActivity, create an instance of MyLoopjTask and inside onClick call  executeLoopjCall with the term entered by the user. MainActivity will look as follows.

Now, if you run the app, you should see the results of your request in the log window.

3. Publish Results to the UI

Separating asynchronous operations into dedicated classes helps keep our code clean, but it means we don't have access to UI elements directly. To show the results of these requests, I recommend creating a listener interface. This is a common strategy, discussed for example in this Stack Overflow question. It has three easy steps.

Create an Interface

First, create an interface with a single method that will be called when the results of the HTTP request are obtained from Loopj.

Update the Asynchronous Task Handler

In MyLoopjTask, modify the constructor so it takes a Context and an OnLoopjCompleted instance as parameters. 

Now, when the request results are available in MyLoopjTask, pass them to the listener interface's method.

Update the Activity

Finally, make the activity you want to update—in this case MainActivity—implement OnLoopjCompleted. Update the initialization of myLoopjTask to myLoopjTask = new MyLoopjTask(this, this);.

Since your activity now implements OnLoopjCompleted, Android Studio will force you to implement the method taskCompleted. There, you can update the UI with the new data.

4. Conclusion

There you have it. When you run the app, all the data from your asynchronous HTTP request will be displayed to the user. Naturally, you will want to parse the received JSON data to extract just the parts you need. For example, you could display the movie poster by passing the poster image URL to Picasso.

In this tutorial, you've seen how to use Loopj, a library to perform asynchronous HTTP requests in Android. Loopj is easy to use with just a few lines of code. Now you don't have any excuse for not keeping your app up to date with content from your favourite web service!


by Pedro Gonzalez Ferrandez via Envato Tuts+ Code

4 Tools for Social Customer Service

ag-social-customer-service-600

Are your customers using social media? Do you want to provide them with better customer service? Today’s tools make it easier than ever for brands to ensure that no customer service issues go unresolved. In this article, you’ll discover four tools to manage customer service on social media. #1: Rignite Rignite makes it easy to [...]

This post 4 Tools for Social Customer Service first appeared on .
- Your Guide to the Social Media Jungle


by Ana Gotter via