Aug 22

We just announced two new ways to get location info from a browser client.

The Gears GeoLocation API is very detailed. It is able to use GPS, cell towers, WiFi, and ip addresses to work out the location, and you get an “accuracy” parameter to see what was available. As well as getting a position, you can watch a position so you are updated when a change happens. This is perfect for mobile devices that have Gears installed, and since the community is working on the W3C Geolocation spec it should be in many more places soon.

To go with the Gears API, we also have an API that goes along with the AJAX APIs, called ClientLocation.

This is an ip based geocoder that we have made available, and is very simple.

I put together a trivial example called Where Are You? that ties together this API with the Maps API:

[ http://almaer.com/whereareyou/index.html ]

You get access to the data from google.loader.ClientLocation, which is null if it can’t be calculated.

Here is a bit of JavaScript that ties it together:

google.load("maps", "2.x");
 
google.setOnLoadCallback(function() {
    if (google.loader.ClientLocation) {
        var cl = google.loader.ClientLocation;
        var location = [cl.address.city, cl.address.region, cl.address.country].join(', ');
 
        createMap(cl.latitude, cl.longitude, location);
    } else {
        document.getElementById('cantfindyou').innerHTML = "Crap, I don't know. Good hiding!";
    }
});
 
function createMap(lat, lng, location) {
    var mapElement = document.getElementById("map");
    mapElement.style.display = 'block';
    var map = new google.maps.Map2(mapElement);
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new google.maps.LatLng(lat, lng), 13);
    map.openInfoWindow(map.getCenter(), document.createTextNode(location));
}
Apr 14

Mobile Web

Russ Beattie has closed up shop for Mowser and people are rushing to declare the death of the mobile Web.

I like Russ, and was glad to see him back on the scene and blogging a storm, even if he can be a touch offensive from time to time ;)

But, just because he couldn’t find the right niche for Mowser, doesn’t mean the “mobile Web” is dead before born.

Take a look at what he really said:

In other words, I think anyone currently developing sites using XHTML-MP markup, no Javascript, geared towards cellular connections and two inch screens are simply wasting their time, and I’m tired of wasting my time.

I agree. Where are the mobile apps today? They are the iPhone specific ones, and a few stripped-down versions. The mobile Web is growing strong from where I sit. I just have to look around at how my own wife uses her laptop less and less, and her mobile browser more and more.

I am so bullish about the Web on the phone that I believe it will be THE platform for building mobile applications in the future.

If you are a hardcore mobile app builder you may snortle a little. Really? Cheesy Web technology can compete with rich application frameworks? Never.

They can, and they will. I was listening to someone talking about the battle of IPX versus NetBEUI. The viscous battle between Microsoft and Novell. This person said: “If you had told me that this TCP/IP thing would beat both of us I would have laughed in your face”. Some crappy thing uses in academia that doesn’t have all of the features that we do? In the battle of IPX and NetBEUI, TCP/IP won.

It will keep winning, and it will come to win in the mobile world. This is why I am excited about Gears for Mobile, and any other work that will come through in HTML 5 and browsers such as Mobile Safari.

It may take awhile, but would you really bet against it? The mobile Web will just be the Web. We will have limitations of course. 3G will take awhile, and the size of screens isn’t going anywhere until we have the dream of projection into your eyes and such.

Would you bet against it?

Mar 08

jPhone

Paul Krill reported that Sun has looked at the iPhone SDK and thinks that it can port Java to the iPhone. It will be placed up on AppStore as an application, so I wonder what the user experience will be for apps that actually run Java, especially for the first time on a phone that doesn’t have it installed.

Don’t get me wrong, I want Java on the phone, just like I want full RubyCocoa, PyCocoa, CocoaJS, and any other language that you fancy.

Background Processes

So, the iPhone doesn’t allow background processes:

Only one iPhone application can run at a time, and third-party applications never run in the background. This means that when users switch to another application, answer the phone, or check their email, the application they were using quits.

This makes me worry about Java too. Startup has never been a good point of the JVM. If I flip to a Java app am I going to have to wait for the bugger to startup? Is there going to be a way to load one VM and keep it loaded (doesn’t seem like it).

It seems like this is just a guideline and not a firm issue:

I’m a programmer and I just tried it [using the iPhone SDK] and you can keep your app running in the background in the normal way ApolloIM and iFob do it. I.e. overriding applicationSuspend.

Even more worrying though is this part of the developer agreement:

3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple’s Published APIs and built-in interpreter(s).

Although it has been suggested that this is to stop non AppStore code, it seems to go a lot further than that.

Open source and the iPhone

Also, Mark Pilgrim has written up thoughts on whether iPhone apps can be GPL:

Since all iPhone apps must be distributed through a third-party (Apple’s “App Storeâ€), that would make Apple the “distributor.†Which would mean that Apple — acting as the distributor of GPL-licensed object code — must provide source code or a written offer to provide source code. It’s analogous to a Linux distribution — they distribute binaries of upstream GPL programs, so they need to host the source code as well.

Feb 29

Darren Waters sat down with Andy Rubin to take a look at an early version of Android:

The software stack, I was told, was Alpha, so not even Beta; but what I was shown gave a good indication that Android should be taken seriously by competitors like Windows Mobile and Symbian.

Google says they are driving the Android initiative because they want to see internet-style development on mobile platforms in the way that the openness of the web has given rise to Facebook and the Web 2.0 movement which should be able to migrate to the mobile phone.

Of course, coming in at the ground level of Android will give Google plenty of opportunity to tailor its own applications.

I got to spend some time with a few Windows Mobile devices this week. I found them incredibly hard to use. I felt like an old person using a device. I think that we forget what the iPhone has done for the mobile industry. it is just so easy to use. Going back to all of these magical keys and no touch screen is soooo painful and backwards. I can’t wait for my touchscreen-screen.

Feb 25

The future is mobile…

I wonder if 2008 will be the tipping point over in the US where we see more developers targeting mobile versus desktop. I am sure it is going to happen some day…. but when is that?

Kevin Lynch at Engage told us that he believes we will be developing for the mobile form factor and extracting desktop interfaces from there, rather than the other way around.

I am twittering the Engage event using hashtags.

Dec 21

I have spoken at a bunch of conferences in Europe this quarter. From the Future of Web Apps, and @mediaAjax in London, to JavaZone and JavaPolis in Oslo and Belgium. When I speak about Gears there, I get a lot of questions about Mobile Gears.

A lot of the features of Gears arguably make even MORE sense on a mobile device. Allowing Web developers to build applications for phones has taken off well thanks to the iPhone. Gears can help out in these high latency devices.

One very handy API to have would be a Location API (although it would be useful in other contexts too):

The purpose of this API is to provide means to fetch the location of a device running a Web browser with Gears.

The Location API is an abstraction for the various LBS APIs that currently exist on mobile platforms (GPS-based, network/cellid-based). The API consists of the Location class, which encapsulates various location attributes (latitude, longitude, etc), and also provides the means to query the platform for a location fix. This API also adds a new event type that is fired every time the location changes. Location implementations can be straightforward mappings to native LBS APIs (e.g the S60 Location Acquisition API) or have a more complex design that combines several location providers (e.g a GPS-based provider and a cell id-based provider) and returns the location from the most accurate provider at any given time.

Here is the API as a code example using it:

// Getting the object
var location = google.gears.factory.create( "beta.location", "1.0" );
 
// Setting up a callback to handle "location changed" events
location.onlocationstatechanged = function() {
   switch (this.state) {
     case 1:
         SetStatusText("Connecting");
         break;
     case 2:
         SetStatusText("Acquiring");
         break;
      case 3:
          SetStatusText("Location accuracy:", this.accuracy);
          MoveMap(this.latitude, this.longitude);
          break;
      case 5:
          HandleError(this.error);
          break;
      default:
         alert("Unknown state!");
   }
}
 
// Initiate a fix. This leads to the onlocationstatechanged event handler being called exactly once for each
// of the "connecting" and "acquiring" states and one or more times for the "fixed" state (for the initial
// fix and every time the location changes, after that).
location.startLocationUpdates(); // async call, initiates fix (powers up GPS if needed, etc)
 
...
 
// Getting the last known location
if (location.latitude != -1 &&
    location.timeUTC > threshold) {  // the location info is valid and not very old
  Foo(location.latitude, location.longitude);
}
 
// Cancel the request. This leads to the onlocationstatechanged event handler being called for
// the "canceled" state. This call will power down the GPS HW / close HTTP connection
// (depending on the location providers that were in use).
location.stopLocationUpdates();

I can imagine the fun games that I could write here, let alone the interesting business apps that could take the location context into consideration.

Other Future APIs

Disclaimer: This is early days, and who knows what the final API will look like, or if it will even make it. Do you have ideas for cool Gears that make the Web better? Let us know!.

Nov 30

Erik Thauvin’s link blog was huge back when I was doing TheServerSide. If you read both the TSS feed and Erik’s you were pretty sure that you were getting a look at most of the interesting content in the Java, and Enterprise Java communities.

I had huge respect for him, and it was sad to see his link blog die out as he got interested in other aspects of life. I can’t blame him. I also moved on from the world of Enterprise Java and got into other technologies and interests. Ajaxian was born to fill my “I love working with communities” itch.

Erik was developing top notch mobile applications and as soon as I launched devphone I knew I had to reach out to him.

So, I can’t tell you how excited I am to see this at the bottom of a post on how Google Maps Mobile works:

devphone 11/30/07 11:00 PM erik Java Networks Windows Mobile

Welcome, Erik. Who know where the ride will lead, but whatever happens, I am honoured to have some fun with you along the way :)

Nov 12

devphone launch

Congratulations to Bob, Cedric, Romain, and the many many engineers that worked on Android.

Today the Android SDK was released, and along with it a raft of video content and documentation.

For all intents and purposes for developers Android == the SDK right now (until killer phones ship in short order). The development experience for Java programmers will be a dream, and I really like the architecture. They have really learned that declarative markup for UI is a Good Thing &tm;.

If you want to get a high level look at what this is about, I would start off by seeing what the phone can do:

This page contained an embedded video. Click here to view it.

Then, if you want to write some code, start by watching Dan build a simple application on Android and then delve deep into the Androidology that shows you the full architecture. Learn what .dex files are. See how cool Intents are. Check out the markup.

devphone.com: phones are decent now

I am really excited to see the bar being pushed by Apple, Google, and other players out there. You know that when the iPhone came out, Nokia had a lot of meetings and engineers got a better budget for doing innovative processes on their phones. With Android pushing the bar too, in a different way, I think that we can safely say that the phone that we hold in a year or two is going to be amazing.

I am quite astounded at how little Emily uses her laptop since she got an iPhone (apart from Scrabulous. She uses her laptop for her scrabble addiction.). You can see the future today by visiting Europe and Asia. Ben and I were so excited about this, that we went looking for a community to rally this excitement, kinda like Ajaxian for mobile. We were surprised that we couldn’t find it. It seems like most developers hang out in the forums and such of the various platforms. Since we are interested in development that transcends one implementation, we decided to start devphone as a place to throw all of the ideas into. It just launched and is very raw, so who knows what will come of it. Check out our welcome, an interview with Joe Hewitt, and subscribe to the feed

Nov 05

One of the fascinating effects of working for a company that so many love to keep a look on is that you get to be on the inside watching the thoughts of “analysts”, press, and random folk.

[image]

Watching the speculation around the “GPhone” has been fun. I particularly loved it when people would come up with suggestions such as:

“The GPhone will read ads into your ear before each call” “The GPhone will have scrolling ads through the screen”

Riiiiight. That would go down really well wouldn’t it! I love how some think that Google has to literally put ads everywhere to make it worthwhile. Google needs the web to keep expanding and to have more people on more devices on it. If that happens, Google will do well.

Android

So there isn’t a GPhone, but instead there is the Open Handset Alliance, or Android (for a more fun name), which is an Apache licensed open source stack for mobile. No more walled garden. This is pretty huge. I can’t wait for the SDK to get out in the open on November 12th. I wish we could have gotten more information out there today to be honest. There are a bunch of usual suspects that people who read my blog also read that are a major part of this, so I am really happy for them that this is getting out in the open!

What I am looking forward to

The applications of course. Smart location-aware services will be fun, but what I really wish I could get is for a mobile digital wallet so I don’t have to use cash/credit cards. I want to use my phone for this just as they are able to do in parts of Europe and Asia. With an open platform that anyone can build applications for, I know it is going to happen.

Here is the fluffy look at Android, but for developers, please think about what apps you would like to see on a phone, and come back on November 12th for the real announcement that we care about… the SDK itself so you can see what you can do!

Jan 09

How long until Billy G comes out with a 2 button iPhone? :)

[image]

I have wanted a phone that is basically all screen forever. They did it Running OS X (Cocoa developer rejoice) Will Flash/Apollo run on that bad boy soon? How many iPods will be on eBay today? I would hate to be in the room w/ Bill G watching this. Nice try Zune :)


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser