2013 MTA App Quest – at Challenge Post

http://2013mtaappquest.challengepost.com/submissions/16890-on-time-all-the-time

I put up a very simple Android application that uses data from MTA services, NOAA Weather and Twitter.  This was done in a few hours and needs some heavy refactoring.

I will start a series of posts on how to make these via TDD with the best Android libraries soon.

http://www.youtube.com/watch?v=cbOTmX-tjaA

http://agilemobiledeveloper.com/OnTimeAllTheTime.apk

Algorithms, Data Structures, Android, HTML5, Java Tools

 

Using Square Retrofit REST Client with POJO

Another helpful resource when using Retrofit is JSON to POJO or JSON Schema 2 Pojo Tool.

In your maven pom.xml.

<dependency>
<groupId>com.squareup.retrofit</groupId>
<artifactId>retrofit</artifactId>
<version>(insert latest version)</version>
</dependency>

package com.agilemobiledeveloper.dataradiator.dao;
import retrofit.http.GET;
import retrofit.http.Path;
import retrofit.RestAdapter;
/**
 * 
 * @author spannt
 *
 */
public class TestGitHub {
 static final String API_URL = "https://api.github.com";
static class GithubUserData{
 String avatar_url;
 String bio;
 String blog;
 String company;
 String created_at;
 String email;
 String events_url;
 Number followers;
 String followers_url;
 Number following;
 String following_url;
 String gists_url;
 String gravatar_id;
 boolean hireable;
 String html_url;
 Number id;
 String location;
 String login;
 String name;
 String organizations_url;
 Number public_gists;
 Number public_repos;
 String received_events_url;
 String repos_url;
 String starred_url;
 String subscriptions_url;
 String type;
 String updated_at;
 String url;
 }
interface GithubUser {
 @GET("/users/{username}")
 GithubUserData user(@Path("username") String username);
 }
/**
 * 
 * @param args
 */
 public static void main(String... args) {
 // Create a very simple REST adapter which points the GitHub API endpoint.
 RestAdapter restAdapter = new RestAdapter.Builder()
 .setServer(API_URL)
 .build();

 // Create an instance of our GitHub API interface.
 GithubUser githubUser = restAdapter.create(GithubUser.class);
 GithubUserData userdata = githubUser.user("nxbdi");

 System.out.println("UserData=" + userdata.bio + "," + userdata.email + "," + userdata.name +
 userdata.location + "," + userdata.public_repos + "," + userdata.followers);
 }
}

The library is really simple to use especially if you create your POJO class with the JSONGen.

Console Output:

UserData=Java, Android, NoSQL, SQL. 20 years experience. MS/BS in Com Sci.,tim@agilemobiledeveloper.com,Tim SpannNew Jersey,205,22




Links du Jour

Echo JS – JavaScript News

dzone.com – BUILD REAL WEATHER APP: JSON, HTTP AND OPENWEATHERMAP

dzone.com – Crossing platforms between iOS and Android with PhoneGap framework. Tutorial

dzone.com – ADB Command Basics and Setup Tutorial

dzone.com – Publishing Android App in Google Play. Things to know ahead!

Code inComplete – Home

Responsive Design Newsletter

The Daily Nerd ☆ Vasilis van Gemert

Status Code: A Weekly Programming Newsletter for Developers and Programmers

Mozilla Hacks Weekly Articles ✩ Mozilla Hacks – the Web developer blog

CSS Weekly — Weekly e-mail roundup of latest CSS articles, tutorials, tools and experiments

Open Web Platform Daily Digest

Smashing Magazine — For Professional Web Designers and Developers

Web Platform Blog | News on the Open Web Platform

Project Euler

aglover/gesticulate · GitHub

Javanotes 6.0, Section 9.2 — Linked Data Structures

Using web workers – Web developer guide | MDN

Droid Development Links

It’s Hip 2 B Square

Cool Android Tools from Square

Android Testing

http://square.github.io/fest-android/

http://fest.easytesting.org/

http://www.developer.com/open/article.php/10930_3901236_3/Write-More-Understandable-Java-Tests-with-Matcher-Objects-and-FEST-Assert.htm

http://piotrjagielski.com/blog/a-cool-technique-for-object-comparison-in-junit/

http://robolectric.org/

http://corner.squareup.com/2013/04/the-resurrection-of-testing-for-android.html

https://code.google.com/p/robotium/

https://code.google.com/p/mockwebserver/

https://github.com/robolectric/robolectric

http://corner.squareup.com/2013/05/robolectric-two-point-oh.html

http://corner.squareup.com/2012/10/mockito-android.html

https://github.com/octo-online/robospice

https://github.com/octo-online/RoboSpice-samples

 

Small Square Tools

http://corner.squareup.com/2013/05/mimecraft-javawriter-protoparser.html

https://github.com/square/protoparser

https://github.com/square/javawriter

 

Event Bus

http://square.github.io/otto/

 

Square IntelliJ Plugins

http://corner.squareup.com/2013/05/intellij-plugins.html

https://github.com/square/dagger-intellij-plugin

https://github.com/square/otto-intellij-plugin

 

Date from Calendar View for Android

https://github.com/square/android-times-square

http://corner.squareup.com/2013/01/times-square.html

 

HTTP and SPDY Client for Android

http://square.github.io/okhttp/

http://corner.squareup.com/2013/05/announcing-okhttp.html

 

Dagger DI

http://square.github.io/dagger/

http://corner.squareup.com/2013/05/dagger-1.0.html

https://plus.google.com/communities/109244258569782858265/stream/bab12891-7685-4e0c-8dcb-f85cd0ca31c0

http://musingsofaprogrammingaddict.blogspot.com/2012/11/dagger-new-java-dependency-injection.html

http://www.infoq.com/presentations/Dagger

http://blog.patrickbaumann.com/2012/10/di-on-android-without-the-startup-cost-dagger/

https://github.com/patrickbaumann/daggervsroboguice

https://github.com/eburke/presentations/tree/master/strange_loop_2012/samplecode

 

Spoon Android Testing

http://square.github.io/spoon/

 

Android Image Caching and Downloading

http://square.github.io/picasso/

http://corner.squareup.com/2013/05/picasso-one-dot-oh.html

http://square.github.io/pollexor/

https://github.com/globocom/thumbor

https://github.com/globocom/thumbor/wiki

 

Android Shake Detection

https://github.com/square/seismic

 

Android Queues

http://square.github.io/tape/

 

REST Client for Android

http://square.github.io/retrofit/

http://corner.squareup.com/2013/05/retrofit-one-dot-oh.html

 

Square OSS Community

https://plus.google.com/communities/109244258569782858265/stream/47c9b7e4-3c13-4f6f-bc89-ede5f9e58612

 

Squash Notification Tool

http://corner.squareup.com/2013/01/squash.html

 

Android Tips

http://www.curious-creature.org/2012/12/13/android-recipe-2-fun-with-shaders/

 

Facebook SDK for Android

https://github.com/facebook/facebook-android-sdk

 

Sending Photos Easy

http://mobile.tutsplus.com/tutorials/android/android-sdk-sending-pictures-the-easy-way/

 

Growing Android Applications Guided by Tests – using Square Tools

http://www.novoda.com/blog/blog/gaagbt-part-1

https://github.com/frankiesardo/growing-android-applications-guided-by-tests

 

Sunday’s Best

SPOCK FOR TESTING
vs just mocking
Continuous Integration JEE
Very cool, you can now use CloudBees Jenkins to Build Cloud Foundry Apps!

Agile


Coding Practices


Spring


REST


HTML5 / CSS3

 

Android Links

 

Today’s Links

Android Development Links

Some Helpful Android Projects

Dagger for IOC/DI

Android Annotations

 

Android + Java + Heroku + JAX-RS

Spring MVC Hibernate Heroku
Embedded JETTY
Embedded Play
JAX RS

Spring and Hibernate

Spring 3.1

http://blog.springsource.com/2011/01/17/green-beans-getting-started-with-maven-and-spring/

http://javarevisited.blogspot.com/2012/03/spring-security-example-tutorial-how-to.html

http://blog.springsource.com/2011/01/25/green-beans-getting-started-with-enterprise-messaging-and-spring/

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/

http://blog.springsource.com/2010/11/09/green-beans-putting-the-spring-in-your-step-and-application/

http://www.springsource.org/greenhouse/guide

http://blog.springsource.com/2011/01/07/green-beans-getting-started-with-spring-in-your-service-tier/

http://www.mkyong.com/tutorials/spring-tutorials/

http://www.mkyong.com/spring3/spring-el-lists-maps-example/

http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/

 

Spring MVC
http://blog.springsource.com/2011/01/04/green-beans-getting-started-with-spring-mvc/

 

Spring Social

http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring

 

Spring Data JPA
http://www.springsource.org/spring-data/jpa

 

Spring Mobile
http://blog.springsource.com/2010/11/19/spring-into-mobile-application-development/

 

Spring for Android
http://www.developer.com/ws/android/development-tools/spring-android-bringing-spring-components-to-your-android-apps.html

http://xebee.xebia.in/2010/12/31/spring-android-spring-for-android/

http://www.makeurownrules.com/rest-spring-maven-android

http://devblog.limettengruen.ch/?p=72

http://blog.orange11.nl/2011/02/07/creating-an-android-app-for-your-website-with-spring-android-and-rest/

http://www.ibm.com/developerworks/web/library/x-springandroid/index.html

http://www.jmanzano.es/blog/?p=163&lang=en

http://www.mkyong.com/spring/spring-sending-e-mail-via-gmail-smtp-server-with-mailsender/

http://www.mkyong.com/spring/spring-quartz-scheduler-example/

 

Spring Hibernate

http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/

http://www.mkyong.com/spring/maven-spring-hibernate-annotation-mysql-example/

 

Hibernate 4.1.4 (JPA 2)

http://docs.jboss.org/hibernate/orm/4.1/quickstart/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/

http://www.mkyong.com/tutorials/hibernate-tutorials/

http://www.mkyong.com/hibernate/maven-3-hibernate-3-6-oracle-11g-example-annotation/

http://www.mkyong.com/hibernate/hibernate-one-to-many-relationship-example-annotation/

http://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/

http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/

More Android Information

MIT App Inventor
http://explore.appinventor.mit.edu/

http://beta.appinventor.mit.edu/


Using Google App Engine
https://developers.google.com/appengine/docs/java/tools/uploadinganapp

http://dl.google.com/eclipse/plugin/3.7

 

Interesting Side Topic:  Android Scripting SL4A (Scripting Layer For Android)

http://code.google.com/p/android-scripting/wiki/AndroidFacadeAPI
UsingWebView

You can use JavaScript, which makes for an interesting environment to call against at Node.JS server.

http://code.google.com/p/android-scripting/wiki/Tutorials

Installing the ASE (Android Scripting Environment) on the PC Emulator
http://www.akeric.com/blog/?p=879

http://www.greenhughes.com/content/sqlite-couchdb-sparql-with-sl4a

Android Menus
http://collegewires.com/android/2012/05/creating-android-menus/

http://coding.smashingmagazine.com/2011/06/30/designing-for-android/

http://code.google.com/p/android-scripting/wiki/AndroidFacadeAPI

Add a View that Display Web Pages using WebKit and Enable JavaScript
http://developer.android.com/reference/android/webkit/WebView.html

<uses-permission android:name=”android.permission.INTERNET” />

 Uri uri = Uri.parse("http://www.example.com");
 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 startActivity(intent);
webview.getSettings().setJavaScriptEnabled(true);


 

Grails

http://grails.org/screencasts

http://grails.org/Tutorials

http://www.infoq.com/minibooks/grails-getting-started

http://www.youtube.com/watch?v=XIoBfhFR9h0

Grails with STS
http://grails.org/screencast/show/50

Basic Security
http://grails.org/screencast/show/49

http://www.grailsexample.net/

Authentication
http://www.ibm.com/developerworks/java/library/j-grails04289/index.html

http://grails.org/Download

http://grails.org/plugins/

http://akanoo.org/

http://grails.org/doc/latest/guide/gettingStarted.html#requirements

Groovy + Grails + H2

http://grails.org/plugin/mongodb

grails install-plugin mongodb
http://grails.org/doc/latest/guide/gettingStarted.html#creatingAnApplication
http://www.springsource.org/sts

Grails + HTML5 + Android + Cloud
https://manijshrestha.wordpress.com/2011/09/10/building-a-native-kind-of-android-app-using-grails-html-5-css-javescript-hosted-on-cloudfoundry/
http://grails.org/FAQ
http://grails.org/doc/latest/guide/commandLine.html#antAndMaven
http://www.grailsexample.net/introduction-to-grails/
http://grails.org/Developer+Documentation
Getting Started with Grails Part 1
http://grails.org/screencast/show/22
http://en.wikipedia.org/wiki/Grails_(framework)#Persistence
http://www.redtoad.ca/ataylor/2012/02/simple-servlets-in-groovy/
http://blog.hypergeometric.com/2012/03/06/groovy-a-reasonable-jvm-language-for-devops/
http://www.craigburke.com/blog/2012/02/09/creating-google-calendar-in-grails-part-1-the-model/
https://github.com/craigburke/google-calendar-grails
http://grails.org/plugin/qrcode
http://www.objectpartners.com/2012/01/12/generating-excel-from-grails/
http://www.bobbywarner.com/2012/01/09/getting-groovy-with-coffeescript/
http://grails.org/plugin/jxl
https://github.com/bobbywarner/grails-coffeescript-demo
http://ui-patterns.com/patterns/ContinuousScrolling
Push AJAX (PJAX) to Grails
http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/
http://pjax.heroku.com/
https://github.com/defunkt/jquery-pjax
http://www.bobbywarner.com/2012/03/19/making-money-with-grails/
http://www.bobbywarner.com/2012/01/12/another-adventure-with-grails-and-coffeescript/
https://stripe.com/
https://github.com/bobbywarner/grails-coffeescript-demo2
Android
http://vladnevzorov.com/2011/07/04/android-application-architecture-part-iv-android-application-integration-layer/

 

Android + MongoDB + Node.js (in progress)

Mobilize Your MongoDB
http://www.10gen.com/presentations/mongodb-berlin/2012/mobilize-your-mongodb-developing-iphone-and-android-apps-in-the-cloud
http://androidclip.com/mongodb-mobile-app-backend-301/

MongoDB with Morphia
http://www.javacodegeeks.com/2011/11/using-mongodb-with-morphia.html

http://blog.jeffdouglas.com/2012/03/25/build-an-api-with-node-js-express-mongodb-and-cloud-foundry/
http://blog.jeffdouglas.com/2012/02/02/using-node-js-to-host-development-web-services/ 

LinkedIn’s Platform
http://www.slideshare.net/phegaro/linkedin-mobile-how-do-we-do-it

Node.js at Heroku
http://www.jamesward.com/2011/06/21/getting-started-with-node-js-on-the-cloud/

http://www.mihswat.com/2011/05/04/getting-started-with-cloud-foundry-using-a-node-js-and-mongodb-application/

VMWare Player for Cloud Foundry
http://www.vmware.com/products/player/

Cloud Foundry
http://docs.cloudfoundry.com/infrastructure/micro/installing-mcf.html

 

 

 

Noiseweb Noise Producer (Android Sound Application)

Noiseweb.com was my first commerical web site coming out in 14-Sep-1997. I had school websites since about 1992, one at Pegasus on the SunOS at Montclair State College (it became a University at the time of my graduation so my degree is from MSU). I had one also on the school’s OpenVMS/Dec Alpha machine, that was my first online resume. I wanted to have one on the VAX/VMS, but they never put an HTTP server on there before it was retired. Basic HTML, since this was pre HTML Form days, that one field with no button  was not worth writing for. Back when web pages were any color you wanted as long as it was black text on a grey
background.

I wrote my first CGI in CSH (No BASH yet, couldn’t go back to CSH) then shell called C++ and finally direct C++ CGIs. I can’t say I miss the days of make files,
no FastCGI and custom CGI libraries. When the search engines were weak and hosted at univerisities, you could not find a lot of good example code. You were stuck buying a
few good O’reilly books and maybe a few documents that came with the tool. Eventually I got STL and a few third party tools, but C++ was a real pain for web development. After
that I got my own hosted website and had a variety of web apps in HTML, Shell, Perl 4 and 5, PHP and some various other scripting languages. I wrote a music store application
for two friends that had industrial music stores in New Jersey and an industrial music zine, but those never really got going. They were using MiniSQL (yes before MySQL) and then MySQL
and sometimes Postresql. I did a lot of Ingres in school (Ingres begat Postres(ql)).

When the Servlet beta spec came out, I was all over that. So much easier to develop and run web apps. The early JDBC and JSP specs were great leaps forward as too. I did some ASP in VBScript, CScript and JScript as well. Visual J++ was not as bad as one would imagine if it wasn’t for the horribly underpowered Pentium PCs we had. Struts was a great leap forward combined with IBATIS. I developed http://www.carragroup.org
with the framework I built on top of Struts, IBatis, Postgresql. I did almost everything. I architected the entire environment. I wrote the framework on top of  Struts and IBatis. I actually rewrote the framework, since I had written my own framework earlier for Charterhouse in the early Servlet days using just servlets, javabeans, jdbc, stored procedurse and protoIOC. I installed, administered the RedHat Linux server with CVS, installed and administered the Postgresql server. I used Postgresql at the time since it allowed for stored procedures that returns resultsets. We had a lot of developers great at writing stored procedures so I wrote a  JSP Tag Library that turned a stored procedure into a “live” table with sorting, paging, etc… from live database data. That site is still running with no one administering it. There are so many beans, actions and pages (hundreds) that our two man team wrote that it would be insanely expensive to port them all. The system has it’s own custom administration screens for dozens of different functions. It’s got an early custom social network built-in with media, chat, forum, maps, documents, blogs, custom navigation and more. This was years before MySpace, Facebook, WordPress, Google Maps or open web APIs. Now we could have done it all with NING or maybe a customized WordPress in much less time with so much less custom code. I got a little off track, but Noiseweb deserves an app. So I am working on a Noise Building application in Android.

Research Links

Capturing Audio in Android
http://developer.android.com/guide/topics/media/audio-capture.html

http://www.techrepublic.com/blog/app-builder/create-your-own-android-sound-board/334

http://www.techrepublic.com/blog/app-builder/getting-your-feet-wet-in-androids-soundpool/877?tag=rbxccnbtr1

http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html

http://www.droidnova.com/creating-sound-effects-in-android-part-2,695.html

http://developer.android.com/resources/samples/RandomMusicPlayer/index.html

http://developer.android.com/resources/samples/TtsEngine/index.html

http://developer.android.com/resources/samples/TtsEngine/src/com/example/android/ttsengine/RobotSpeakTtsService.html

http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/

http://audioprograming.wordpress.com/2012/03/16/a-general-purpose-ui-for-csound-on-android/

http://audioprograming.wordpress.com/2012/03/03/android-audio-streaming-with-opensl-es-and-the-ndk/

http://audioprograming.wordpress.com/2012/03/07/a-simple-delay-example/

http://eurodev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html

http://developer.android.com/reference/android/media/AudioTrack.html

http://developer.android.com/reference/android/media/AudioRecord.html

http://www.benmccann.com/dev-blog/android-audio-recording-tutorial/

http://mobile.tutsplus.com/tutorials/android/android-sdk-using-the-text-to-speech-engine/

http://audioprograming.wordpress.com/2012/03/16/a-general-purpose-ui-for-csound-on-android/

http://supercollider.sourceforge.net/

http://supercolliderbook.net/

http://sourceforge.net/projects/pure-data/?source=recommended&_test=goal

http://blue.kunstmusik.com/

 

Backup API and Service
http://developer.android.com/training/cloudsync/backupapi.html
https://developers.google.com/android/backup/signup
https://developers.google.com/android/backup/

 

General Android
http://dev.blogs.nuxeo.com/2011/10/speeding-up-the-android-emulator.html