Can anyone really afford to develop for Glass?

Google recently released documentation for the Mirror API, the REST API for Google Glass. There isn’t really anything there that should be surprising to anyone who has kept up to date with Glass-related news given lately. This was all demonstrated in Timothy Jordan’s SXSW talk about the API last month. Even at that point, it was clear that the Mirror API is rather limited. While it did show that Google is mindful of limiting the distraction of Glass and making it something that simply sits in the background, the nature of the API also highlighted Google’s intention of making Glass an all-day device and limiting the toll apps will take on the device.

With the release of the documentation, Google also announced two particularly controversial details in the Terms and Conditions:

No Ads. You may not serve or include any advertisements in your API Client.

No Fees. You may not charge end users any fees or collect any payments in order to download or access your API Client, or in connection with virtual goods or functionality of your API Client.

Effectively, developers have no way of monetizing their apps. This caught my eye, and apparently others took note as well. I posted an article from CNET to Hacker News and watched the discussion from developers. The main discussion revolves around the quality of applications this will prompt, comparing this future Glass app market to the Linux desktop app ecosystem or that of Apple’s iOS from the early days. Essentially, people are wondering what it means if developers have to build for free.

One problem: it’s NOT free. Did everyone forget that this is a REST API? Somewhere, you’ll need a server for your app to interact with the Mirror API, and running a server isn’t free. With constant calls between Glass devices and your servers, it wouldn’t be unreasonable to guess even small-scale applications could get expensive, perhaps too expensive for someone who’s just “building software for fun.” What happens when you build a fantastic, innovative new app, maybe one that gets featured somewhere prominent? If you were developing for Android or iOS (or perhaps iMonocle) you might be pleased with the ensuing profit or recognition, but with Glass you may be forced to shut down your app instead due to rising server costs.

I’m all for building software as a hobby, half of my projects are just for fun and make nothing in profit. However, it just makes sense to encourage development of apps that will drive Glass forward with the incentive of potential profit. Afraid of junk apps cluttering the market? Don’t let people release junk apps, it’s worked for Apple quite well. This isn’t a question of “hobby vs. business”, it’s a question of who is really willing to pay to put countless hours towards building an app. Free is fine, as long as it’s free for developers too.

16
Apr 2013
AUTHOR Mark
CATEGORY

Uncategorized

COMMENTS No Comments

Google Glass Application – #ifihadglass

I’m super excited about Google Glass and even more excited that they’re giving people the chance to get their pair early. I spent this weekend working on my application and as you can see there I’ve put it all into a nice website to send around and share. Hopefully this extra effort will show and I’ll get a chance to get a pair early. They’re grading on things like creativity and originality, and I think I’m hitting those targets.

This is my favorite concept image. This concept has a lot of potential, at least in my opinion. With the motion tracking capabilities of Glass, you could determine the location of significant potholes by sensing a bumpy portion of the road when a driver goes over it. You could crowdsource this with all Glass users or even simply smartphone users with an app to track this to contribute to the data. You could also track license plates to answer that ‘Didn’t I see that car this morning?’ question. Nothing very useful in that, just pretty interesting.

Those selected to get Glass early will have to travel to a Google office to pick theirs up, and they’ll also have to foot the $1,500 pricetag. Like others, I’m more than ready to pay that plus travel expenses to play with this early. As a developer, that early involvement could be worth a whole lot more than the $1,500 plus travel expenses in app sales later on. I could be wrong, but given the response so far, I’m sure people will be willing to pay a whole lot more than $1,500 to buy it from selected applicants, but I don’t think I’d sell it, it probably wouldn’t even be legal.

I’d really appreciate it if you could share the site, videos, Google+ post, anything really. Ultimately, I’d just like to get this out there and see what people think. The only judges that matter are those at Google who will be reviewing applications. I probably put too much effort into this, but I had a good time coming up with the concept apps so it wasn’t all time wasted.

26
Feb 2013
AUTHOR Mark
CATEGORY

Uncategorized

COMMENTS No Comments

Learn with Google for Publishers Event

Yesterday I attended the Learn with Google for Publishers event in Toronto, and I wanted to write a quick summary because I didn’t find a lot of useful information regarding the event when I first received my invitation. I’m glad I decided to go without really knowing what to expect, because I certainly gained a lot from attending and would encourage you to do the same if you can.

I’ve been an Adsense publisher for a little over two years now, and my earnings have steadily increased over time. I’m not sure if it required a certain threshold or not to be invited, but everyone there seemed to be doing quite well with their Adsense endeavours. The networking aspect was certainly the most valuable, even though the seminars were extremely informative and revealed a few things I’m already excited to try with FIFA Encyclopedia to see if I can boost my Adsense revenue a bit. The social atmosphere was nice and people were very friendly; multiple people came up to me, introduced themselves and seemed interested in hearing what I was doing and eventually telling me their Adsense situations.

They served breakfast and lunch and had a little buffet thing going at the end, so there were plenty of opportunities to socialize and network with like-minded publishers. We were given a bag with Google memorabilia and papers with the agenda and other information, and this included unfilled business cards that many seemed to find useful in their networking. I always like to run ideas by people in this kind of business, so whenever I have someone’s email and they can put a face to my name, that’s an incredibly valuable thing for me.

Although I attended the Toronto event, the Google Adsense employees there were from the Mountain View Google headquarters. I had a few questions about tax and other topics specific to Adsense, so it was very useful to have my questions answered one-on-one with Google employees who seemed more than glad to help attendees. The seminars were similarly helpful; I attended the Site Optimization, Google Analytics, and Advanced DoubleClick for Publishers sessions for the ones I could choose on, and everyone saw the first, introductory session along with the Go Mobile and Get Social seminars in the afternoon. I personally didn’t like the Get Social seminar because it’s very clear they are trying to push their Google+ agenda with their publishers. While there are obviously benefits, it was difficult to not find their claims exaggerated given the usual perception of Google+. I will still consider their advice, but I think they need to acknowledge that other social networks are equally, if not more valuable if their ultimate goal is to increase publisher revenue.

Overall, I am glad I attended the event and I’m eager to see how or if it pays off soon! Sorry this is a bit short, I just wanted to get something out quickly.

20
Feb 2013
AUTHOR Mark
CATEGORY

Uncategorized

COMMENTS 3 Comments

Android – Logging into a website programatically without HTTP authentication

A major problem I ran into when I was working on my first Android app, NetClassroom (you can read more about this in the Projects section), was that the login site I was adapting into an Android app did not allow me to post the login credentials to the server and wait for a response. If I couldn’t do this, then the app would be impossible to make. Even if I was able to get my own school to allow authentication like this, the app would still be incompatible with the 100+ schools I was planning on including as it seems the default settings prevent authentication.

Looking around on StackOverflow yielded few leads, mainly people suggesting a WebView to display the page, but the whole purpose was to escape the poor mobile experience of the actual site. Like solving any other programming problem, when I actually thought of a solution, it was unbelievably simple.

Taking the login information is easy, so I’ll assume you already know how to do that. From there, you can just send the credentials to a activity with a WebView, which allows you to load in JavaScript. What does this mean? It means you can literally tell the WebView: “Put the username and password in the appropriate inputs, and click the login button.” So lets go do that.

First you need to declare your instance variables. As mentioned earlier, we’re going to be working with a WebView, so declare that. I don’t know how you’re getting your username and passwords. For me, I included them in a bundle when I started this login activity, but that’s just my case.

WebView mWebView;
int countLoad = 0;
String URL = "www.example.com"; //Your login form
String username;
String password;

Because this is done within a regular activity, you have to put a WebView declaration somewhere in the XML layout you are using for this activity. Mine’s id is just ‘webview’, as seen in the first line below. About View.GONE: I did this a while ago, but I think I ran into some problems making it an AsyncTask, which is why I just did this whole login process in its own activity. I don’t want to show the WebView, so I set the visibility to View.GONE so it would be black while it the app logs in. I also put a ProgressDialog over it, but that’s just me.

You also need to enable JavaScript so we can load JavaScript into the WebView. That line (3) is pretty self-explanatory. The last line injects the jsInterfaceObj object into the WebView context, which allows the object’s public methods to be accessed from JavaScript. It’s alright if you don’t understand this. Basically, the last two lines allow us to inject JavaScript and adapt a JavaScript interface that sort of connects the JavaScript to this.

mWebView = (WebView) findViewById(R.id.webview);
mWebView.setVisibility(View.GONE); //You can delete this line while you are testing just to see how it works.
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.addJavascriptInterface(new jsInterface(), "HTMLOUT");

You also need to define the aforementioned jsInterface class so that we have we can tell the interface what to do with the HTML we’re going to eventually get. So define the following class somewhere. I’m just adding the HTML as an extra which you can extract in the next class, but you can do whatever you want with the HTML that we’re getting.

class jsInterface{
    public void showHTML(String html){
        String test = "";
        Intent openNewActivity = new Intent("android.intent.action.yourintent");
        openNewActivity.putExtra("HTML", html);
        startActivity(openNewActivity);
    }
}

Okay, now it gets a little trickier. We need to add a WebViewClient, which basically allows us to tell the WebView what to do. In this case, we’re telling the WebView what to do when loadUrl() completes, and we do this by defining onPageFinished().

Remember the loadCount variable we initialized before? Here’s where that comes into play. After we initially use loadUrl() to load the login page (which we haven’t done yet), it refers to onPageFinished() and sees that we want to run this secondary loadUr() that loads in JavaScript. We are using the loadCount to prevent a never ending loop. After the login page URL is initially loaded, we want it to load the JavaScript (when loadCount is 0). When this secondary loadUrl is finished, we want to grab the HTML of the page (when loadCount is 1). We run the interface’s showHTML function with the HTML (which is returned from pretty simple JavaScript) as a parameter. If you remember, I just bundled it into a new activity, but you can do whatever you want with it.

Also note the JavaScript getElementById function: remember to change the input ids to match that of the page you’re working on. If, for some odd reason, you aren’t already using FireBug or something equivalent, I highly recommend you download something, as it will come in handy in situations like this.

mWebView.setWebViewClient(new WebViewClient() {
    public void onPageFinished(WebView view, String url) {
        if (loadCount == 0) {
            mWebView.loadUrl(
                "javascript:document.getElementById('sid').value = '" + username + "';"+
                "javascript:document.getElementById('pin').value = '" + password + "';"+
                "javascript:document.getElementById('btnLogin').click();"
            );
            loadCount++;
        } else if (loadCount == 1) {
            mWebView.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');");
            loadCount++;
        }
    }
});

Finally, you’re in. If you run the following code, the showHTML function will run and your activity will open with the returned HTML as an extra. Also keep in mind the fact that this HTML is of the page that the user is sent to when he logs in with valid login credentials.

mWebView.loadUrl(URL);

That’s it. It’s probably very simple for anyone with considerable experience, but as a beginner I had a lot of problems trying to get this to work, so I thought an in-depth tutorial like this would help someone. Please let me know what you think. If you need some help, don’t hesitate to comment below or send me an email and I’ll do my best to try and help you out. Thanks for reading!

19
Jul 2012
AUTHOR Mark
CATEGORY

tutorials

COMMENTS No Comments

First post

My name is Mark Lyons and welcome to my personal blog! This blog is something I’ve put off making for a while now, but I’ve finally got around to it. I’m a 17 year-old web developer and programmer, so you can guess what I will be posting about mainly here. It’s kind of pointless to post a really in-depth explanation of myself as the first post when I have an about page, so take a look there if you’re interested in that.

I didn’t want to spend a huge amount of time building this site, so I just went with a regular ol’ WordPress blog with the Dispatch theme by Mike McAlister, who I really have to thank for making such a solid, beautiful theme. I’ll update this blog with a few posts per month, but only as long as I have something useful to post. I’m new to this kind of blogging so it should be an interesting experience. Thanks for reading!

12
Jul 2012
AUTHOR Mark
CATEGORY

meta

COMMENTS No Comments