Monday, October 29, 2012

Duplicate Apps


Apple or Android!  I was at a friendly birthday dinner the other day, and this topic was brought up, and things got ugly.  I've never been much of a "fan" in any respect of my life.  I love sports, but I don't have a favorite team.  I love technology, but I'd switch between one brand to the next without any sense of betrayal or loyalty lost. 


With that said, I am an Android user (both phone and tablet) and even more so, an Android developer.  Needless to say, I'm biased.
 
One difference between Apple and Android is the app ecosystem.  In the Apple world, before an app can be published for distribution, it must pass a review process by Apple.  In the Android world, no such barrier exists.  In comparisons between the two phone types, this is often mentioned as a plus for Apple.

Since Apple reviews apps before publication, the apps in their store will tend to be of higher quality.  Inferior apps, that drain system resources for example or simply duplicate the same features as another app, will be rejected from the Apple app store.  In contrast, when I searched for 'notepad' in the Google Play store, I got 4493 possible notepad apps. From a user's perspective, this may make the Apple seem experience better.

This feeling is pretty different from the developer's point of view (at least my point of view).  In the Android world, we are free to publish whatever we make.  There isn't a seemingly arbitrary judge who deems whether our app is good or not.  Furthermore, we are free to use free tools, which makes the bar to enter even easier to cross.

So, it seems that Apple will have a nice curated selection of apps, and Android will have a mish-mash of good apps hidden by a mountain of poor apps.  Thankfully, the Android app world has a pretty good way to help users find the best apps.  User-reviews.  These reviews make it pretty simple to identify the cream of the crop apps and skip the poor ones.

I see the Android app world as being similar to the internet.  Anyone can create any kind of website or app.  The best sites and apps will eventually be found and used, while the poor ones will not be.

Which ecosystem do you want to live in?  Do you want to be in a world with curated content (maybe like the New York Times choosing which 1000 articles are sent out each day)?  Are do you want to be in world like the internet, where there is good content, almost completely hidden by mountains of bad stuff.

Harden and me to the Rockets

Because of Yao Ming, I used to follow the Houston Rockets pretty closely.  But my interest in the team and their viability as a contender, has waned since Yao's retirement.

The pick-up of Jeremy Lin earlier in the year did little to capture my attention.  The story of the Rockets seemed to be tragically uninteresting.  Yes, Lin would be a young talent surrounded by other young talent.  But the team felt a bit, incomplete.  This team was almost destined to lose in the first round of the playoffs, if lucky, in a completely forgettable way. 

But now that James Harden has been traded to the Rockets, everything has changed.  Harden and Lin are incredibly interesting.  Young, trendy, smart and they can ball.  I have no evidence to suggest that they will play well together, but I have a feeling that they will mesh.  Both are pretty good spot up shooters, and both are good at driving and kicking out to spot up shooters. 

As a sign of my new found enthusiasm, I have just re-subscribed again to red94.net, a pretty great Houston Rockets blog that I used to read regularly.  I suggest you do the same.






Houston Rockets Jeremy Lin Player Tee - Men (Google Affiliate Ad)

Sunday, October 28, 2012

Lather, rinse and repeat

Here are the steps I take when I want to update my Android app.

- Uninstall the app on my phone.
- Create a new git branch.
- Make updates.
- Test on emulators.
- Commit changes to git branch.
- Use Eclipse to publish a new signed version.
- Use Airdroid to upload the new apk and install it onto my phone.
- After testing for a day, I publish the change to the Google Play Store.
- Push changes to github.

Anyone have a similar workflow, or could suggest improvements to my workflow?

Saturday, October 27, 2012

Windows

Recently, I've been helping my wife shop for a new ultrabook that would run Windows 7 or perhaps Windows 8.  At the same time, in the upcoming weeks, my work computer will be upgraded from Windows XP to Windows 7.  With all this upgrading, I have to say I'm pretty excited about the newest Windows products.  Even though we probably won't buy the new Surface tablet,
Surface - see http://www.microsoft.com/Surface/en-US/surface-with-windows-rt/help-me-choose

the possibility of Windows producing something interesting again, is well, exciting.

Tuesday, October 9, 2012

To the cloud

I'm thinking about building another Android App. 

For this app, I'd like to do some cloud-based things.
1. Sync my user's data to the cloud.
2. Use cloud computing to do some powerful user-specific analysis.

The two most robust options seem to be either Amazon Web Services or Google's Cloud solution.  Here are some points for why Google's App Engine looks good for me.

Cost - "With App Engine, you only pay for what you use. There are no set-up costs and no recurring fees... App Engine costs nothing to get started. All applications can use up to 1 GB of storage and enough CPU and bandwidth to support an efficient app serving around 5 million page views a month, absolutely free."

Handling Users - "APIs for authenticating users and sending email using Google Accounts"

Data storage - Google Cloud SQL provides a relational SQL database service for your App Engine application

Development experience - There is support for development with Eclipse and Java, making it a natural extension to work with my Android Apps.

I'm working through this installation/tutorial now.

App Usage Monitor

What is the App Usage Monitor?

It's an Android app that I have building since mid 2012. This app measures how much time you spend using a given Android app. More specifically, it measures how long you have a given app opened in the foreground. 

What else is the App Usage Monitor?

This is the first Android App that I have developed, and it started as a way for me to learn about developing android apps.  I thought it was pretty informative, so I decided to publish it for others to use.  I have documented my experience building this app in this blog.

Can I export the data?

I am working on it. The latest version of the app syncs data to a cloud backend. Once this cloud backend is working correctly, I hope to provide a lot of cool functionality, one of which is easy exporting of data.

Feedback

Please feel free to leave a comment or email me directly, email.dhan@gmail.com. If you are a happy user, please spread the word by reviewing the app on the Google Play Store.

Saturday, October 6, 2012

Saving output somewhere else

I wanted to allow users to save text data that is on their phone to third-party applications like to email or on Google Drive.  The best way to do this seems to be using ACTION_SEND intents as described here.

Code like this, will put the text you want to send into the body of an email message or will create a new document on Google Drive.
public void send_data() 
{
// Create an intent to send data out
Intent send_intent = new Intent(android.content.Intent.ACTION_SEND);
send_intent.setType("text/plain");


String data_to_send += "Sending this data string";
send_intent.putExtra(Intent.EXTRA_TEXT, data_to_send);

startActivity(send_intent);
}
Or, you can put the text data into an attachment with something like this.
public void send_data() 
{
String FILENAME = "sample.txt";
FileOutputStream fos;
try
{
// Set the file as world readable so other apps can read it.
fos = openFileOutput(FILENAME, Context.MODE_WORLD_READABLE);

// Update the file and close it.
String data_to_send += "Sending this data string";
fos.write(line_to_send.getBytes());
fos.close();
} catch (IOException e ){}

// Create an intent to send data out
String full_path_file = getFilesDir()+"/"+FILENAME;
Intent send_intent = new Intent(android.content.Intent.ACTION_SEND);
send_intent.setType("text/plain");
send_intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+full_path_file));
startActivity(send_intent);
}
This all works well, but when I try to open the document in google drive, I find that it isn't a native Google drive document, and the only thing I can do is view it.

I will update later again if I can find a way to improve this.

Thursday, October 4, 2012

Git, Eclipse, Can't we all just get along?

I've been using vim and cvs for all of my programming life. I'm still using them.  But I thought it was time to step into the 21st century. So here I am, building android apps with the modern Eclipse IDE and the trendy git versioning system. 

Thus far, I have been impressed.  Git is powerful and Eclipse is one smart tool; autocomplete alone feels like magic.  But, it hasn't all been easy. 

Here are the two scares I had:

1. In eclipse, I created a branch.  I made my edits, and then I asked eclipse to merge the branch back into the master. I've done this before, but this time Eclipse had issues.  I don't remember the error message, but there were errors everywhere.  So, I asked Eclipse to switch back to the branch I was working on. Oops. Eclipse said No to that too.  Ok.  I'll restart Eclipse.  Crap.  Eclipse opens and the project is empty.  I ask to switch branches, nothing. Eclipse says that there were merge errors and I'm not allowed to switch branches.

I went back to the terminal. I opened the folder where my git repository is, and there was nothing there. After a moment of stupid panic, I ran 'ls -a' to see the hidden files.  Aha, there was '.git'. So I ran 'git branch', saw my branches, and checked out my last good branch.  I merged files using the command line and all was well again.

I'm not sure what I did. I don't know why eclipse decided that the best way to do a merge was to hide all my files. It was probably something that I did.  Oh well. Ok, I'll just merge from the command line and not within Eclipse anymore.

2.  All has been going well. I code and debug in Eclipse.  I create and merge branches in the terminal.  But one day, I open the project, and I have lots of errors. 100s of errors.  After going crazy for a bit, trying to build, clean, changing build paths and so forth ... I was ready to give up. Screw these shiny magical tools.  I never know what the heck is going on.  Well, I realized after a bit that Eclipse had wrecked my imports.  I deleted the ones that were there and re-added the ones I needed manually.  Who knew that Eclipse or Git would decide to change my imports?  I have no idea what happened.  Oh well.

I guess, what doesn't kill you ... gives you something to blog about.