Category Archives: Android

Some Updates

Today I’m going to give you some updates on things I’ve talked about in previous posts:

First, the Nexus 10 issue with USB Debugging: It turns out, the issue is in CyanogenMod. I installed AOKP, which is based on CM, and had the same issue. I went back to stock and it worked perfectly. So I guess I need to file a bug report with the guys at CM.

Next, the new look for 4.x: I said I was changing the check boxes to on/off switches. This is great… except in one area. (I also said in that post that I had not fully tested this yet.)

For some reason, the “SwitchPreference” doesn’t quite work as I would expect. I was working on something unrelated yesterday (I found a way to use an option to actually change the icon of the whole app, not just the icon of the notification) and realized while I was working on it, that these Switch Preferences did not quite work properly.

(WARNING: technical information included below. You may not understand all of this if you’re not familiar with programming.)
The problem is this: when I click on the on/off button it reacts differently than if I click on the text NEXT to the button.

If I use OnPreferenceClick, nothing happens at all when I click the button, but the function is called when I click the text.
If I use OnPreferenceChange, the function is called with the OLD value if I click on the button, and if I click on the text it’s actually called twice: once with the old value, and again with the new value.

This leaves me with an issue: how the heck do I deal with 1 item reacting in 2 completely different ways depending on how it’s interacted with? The answer: I still have no idea. If you have ANY insight as to how this works, I would LOVE to hear from you with ideas. In the meantime, I’m going to post on Stack Overflow and see if anyone there has any insight.

(END OF TECHNICAL INFO)

Well, that’s the news as of right now. Still no work on individual responses… I keep getting distracted by other things.

As always, let me know if you find any bugs or have any requests. And if you have any insight into the above problem, please let me know.

UPDATE: I figured out what I was doing wrong:

(Another WARNING: technical information below)
in OnPreferenecChange there are two parameters: Preference preference and Object o

Apparently preference holds the preference that is being changed, and o holds the boolean value of its state after the change. I was using preference.isChecked() as my reference, and had to change it to use o. (cast o as a Boolean, then use that value.)

(End of technical information)

I’m still working on figuring out all of the details of how to change the icon. I’ve figure out most of it, but there is a small side effect that some users may not like, so I’m trying to handle that before I finalize anything.

I’ll keep you up to date on progress 🙂

Another User Request

I’ve gotten another request from a user via a Play Store comment. Since I cannot respond to comments on the Play Store, I’m hoping that the user will see this post.

First and foremost… if you have a request for a feature PLEASE email me! That way I can reply directly. My email is listed on the Play Store and in the app in the “Credits” screen.

Now, onto the request. It was a 2-part request:

  1. Custom replies for individual contacts – as I’ve mentioned here before… I’m working on that. The hard part is not the coding, it’s working out in my head exactly how I want it to function. I think I’ve finally got it figured out, so I’ll probably start coding soon.
  2. “no reply option for non contact list numbers” – This is already done by default in the app. I thought it was in the app description on the Play Store, but apparently it’s not. However, it IS in the “About” screen in the app – “It will only respond to contacts in your address book”
    1. This is done because I don’t want to be sending text messages to non-cell phones. Therefore, when a response is being sent, the app first checks to see if the number is in your contact list. If it’s in your contacts, it checks to see if the contact is in your “do not respond” list. If it’s not in your do not respond list, it checks to see if the number is listed as a cell phone. If the number fails ANY of these checks, the response is not sent. (Oh, and after the cell phone check, it checks to see if the number has already been sent a response during the current session.)
    2. If anyone knows of a better way to check to see if a number is a cell phone, I’d love to hear about it. But I did some research early on, and right now this seems to be the only way to do it.
UPDATE: The information in #2 has been added to the Play Store description under “Features”, and #1 has been added in the description under “Ideas for future versions”.
There you have it. Some requests, some replies, and some insight into how the app actually works. I’ll be willing to bet that a lot of you had no idea there was so much going on before your response is sent. Fact is, there is a LOT going on in the background of this app that you don’t think about unless you’re the one who’s coding it. And the best part – all of this happens in a matter of milliseconds, so your response is usually received before the recipient has a chance to put their phone down. (assuming that you both have a good connection to the cell network.)
Side Note – I don’t know how many of you will actually use this, but I think I may have gotten the “Ignore Call” option working. I’ve yet to actually test it (I hope to do that today) but I actually understand how the code is working now. I added this option into my settings screen a while back, but it was disabled because it didn’t work. Then I removed it completely because I couldn’t fix it. Well, I may have finally fixed it 🙂

Then and Now – Auto Respond from inception to today

For those of you who haven’t seen every version of Auto Respond, you may have no idea how far it has come.

Tasker:
This app actually started as a set of Tasker profiles, which automatically sent a response to text messages while my phone was docked in my car. I’m not sure if you could do all of what it does now, even with 30 Tasker profiles.

From there, I used Tasker’s App Factory to turn my Tasker profiles into a simple app, with a simple interface. (I used literally the first ever publicly available version of App Factory to do this.)

It looked like this:

Pretty hideous compared to what it is now, and the icon was just something I pulled from Tasker. Because it was so hideous, I decided to learn how to make an ACTUAL Android app, and code it myself. The first coded version looked a lot better, but still needed a lot of improvement.

My Own Code:
I asked a friend of mine from high school, who is into digital design, to design an icon for me. I told him I wanted something that looked like the stock Android messaging icon, with an arrow pointing left, signifying a response. He came up with the icon I have now, but with a white arrow… I used GIMP to add the blue to give it a little more contrast (and to fit the ICS color scheme.)

Above is the first coded version. As I said, a step in the right direction, but still not quite there. Even the title bar did not follow Android convention. The icon was only actually visible in the app drawer. Plus, at this point, the functionality was still pretty basic: enable/disable and car dock functionality. No scheduler, no responding to voice calls, no silencing ringer… none of the other options that I have built in today. (It didn’t even have a menu to put options into.)
The list of messages had no details, no sorting… just the name of the message, and an option for a new message. And if I recall correctly, there was no edit on those messages either, just delete.
There were only 3 screens in the whole app… the two shown above, and the “New Message” screen.

Where I am Now:
It’s amazing that in about 3 months, it went from that, to this:

(For the record, the red and purple icons were edits that I made using the original icon in GIMP.)

This is a LOT more pleasing to the eye, and it more closely fits in the Android standards. The app now has roughly 20 screens, maybe more, when taking into effect the various settings screens, the about screen, help screen, feedback screen, scheduler screens, etc. Some of these screens even have 2 different design files – one for Android 4.0+, and a separate file for Android 2.x. This is necessary because of the different design standards between operating system versions, and some of the new features in 4.0+ will cause the app to crash in 2.x. (Yeah, there’s a lot more to it than most people realize!)

For those of you who can apply themes to your phone (some phones/ROMs come with a way to apply themes, some don’t) part of those themes may apply in the app!

I downloaded a theme called “Blue Elegance”, and it made the app look like this:

Pretty sweet huh!?

Moving Forward:
Today, I did a little more overhaul of the look. All of the check boxes are now on/off switches for users on Android 4.0+. For those of you on 2.x, sorry. In order to give you switches like that I’d have to design a custom view, and it would be entirely too much work for a small interface change.

If you are one of the few people using the paid version on Android 2.x, the check boxes for the schedules are now toggle buttons. (not the same as the on/off switches available in 4.0+, but similar.)

I have not fully tested these changes. They seem to be working in 4.2, but I want to make sure that none of the changes messed things up in 2.x, and my emulator on wasn’t working properly when I originally wrote the code.

Also, this is a small change, so I will likely try to build in some more changes before releasing a new version. This post was more to show the progression of the app, and mostly the progression of the interface.

Conclusion:
I hope you enjoyed the journey from having an idea for an app, to having a fairly polished app on the Play Store. I put a lot of work into this app, and take a lot of pride in my work. This should show you exactly how far I have come in a matter of a couple months!

If you want to see ALL of my screenshots over the multiple versions I’ve released, they’re all in a public folder in my Dropbox.

https://www.dropbox.com/home/Public/Android/Auto%20Respond/Screenshots

More Nexus 10 Issues

I’ve come to realize something about my Nexus 10… and I’m not sure if it’s an issue with MY nexus 10, or all Nexus 10s.

For some reason, this thing is REALLY finicky with the USB debugging mode. At home, I had to switch USB cables for my computer to even recognize the device. It was charging, but Windows did not see it at all until I switched cables.

Now, at work, I’ve tried 2 different USB cables with the same result for both cables: Windows recognizes the device, the drivers are installed, but it does NOTHING beyond recognizing it. It usually shows as a device in “My Computer”. It’s not there. IntelliJ IDEA (my programming IDE) doesn’t recognize it. The ONLY places I can find it is in “Device Manager” and in the “Devices and Printers” screen.

I’m not sure, however, if this is a problem with the device, or possibly a problem with CyanogenMod. I just flashed CM a couple days ago, and haven’t actually connected it to ANY computer since then, so it’s possible that the issue is actually the ROM. However, I have not yet tried restoring my backup, or flashing back to stock, to see if the issue remains.

Auto Respond 1.2.8.2, Tic Tac Toe 1.1.1

I just published a small update to Auto Respond. This update moved some menu items around a bit, and added a new item “My Other Apps”. This will take you to a market listing where all of my apps will be listed. Right now that list only includes Auto Respond and Tic Tac Toe.

I also published a small update to Tic Tac Toe. I added menus, similar to the ones in Auto Respond (with the exceptions of settings… although I may add a couple small settings later.)

There is now a Credits screen, a Help screen, and a few other menu items.

The “My Other Apps” item was also added in Tic Tac Toe. PLEASE NOTE that if you click this item in Tic Tac Toe and are using a tablet, you will ONLY see Tic Tac Toe in that list, as Auto Respond is not currently available on tablets. (I hope to eventually build in functionality for DeskSMS and TabletSMS, at which time it will be available on tablets.)

As usual, these updates are not available quite yet, but they have been published. They should get pushed through Google’s servers in a couple hours.

Auto Respond 1.2.8.1

Yesterday, I drove to Buffalo for work for the first time in many months. Much to my surprise, I docked my phone and Auto Respond did not automatically start.

I looked into this, and turns out… there were some bugs in my docking code. This has now been fixed, and the new version has been published. (It may be a couple hours before it’s live on Google’s servers though)

In order to make the docking options work again, you may need to go into the dock options screen and toggle all of your active options off then back on.

Sorry for the inconvenience.

As usual, if you find a bug like this PLEASE let me know. I take information like this well, and I WILL look into it if you report something like this. I’d rather have someone tell me that my app is not working properly rather than have an app on the market that isn’t working as advertised.
I am human. I occasionally make mistakes, and am willing to admit to my mistakes.

New apps!

I think both apps are ready!

Auto Respond:

The only thing I didn’t finish is adding the new settings to individual schedules. To tell the truth, I’ve just been too lazy to do it.

Change Log:

  • Fixed a bug with “Silence Ringer” option
  • Fixed a bug with “Desk Dock Response Message” in “Dock Settings” screen
  • Fixed a bug which caused the “OK” button on the main settings screen to disappear on orientation change
  • Made responding to text messages optional
  • Changed some more “Cancel” buttons to “OK”
  • Added Analytics to learn how users interact with the app
  • Added “Share App” option to menu
Tic Tac Toe:
It’s done! Roughly 36 hours after I started, I have a playable version of Tic Tac Toe with 3 difficulties:
  • Easy – chooses a random number, and if the spot is free, it moves there. If not, it chooses again until it finds an empty spot
  • Medium – If it can win, it wins. If it can block, it blocks. Otherwise, same random number scheme
  • Impossible – If you can win (not tie, actually win) I did something wrong.
I have a very simple icon for it, and some basic graphics… nothing too amazing it’s Tic Tac Toe!
I do still need to add some advertisements to it, just to attempt to bring in some small amounts of cash, but that’s quick and easy.
Neither of these have been released yet, but I will likely upload them late tonight or early tomorrow.

New App: Tic-Tac-Toe

Yesterday I started some initial work on a new app. This is actually something that I already have programmed as a DOS based C++ program, I just need to build a GUI and translate the code from C++ to Java.

Background
In college I received a project to build a Tic-Tac-Toe game. That was the only requirement… build a working Tic-Tac-Toe game. There was extra credit involved if you were able to make your game unbeatable. For those who don’t know, by using the correct logic while playing, it is possible to never allow your opponent to win a game of Tic-Tac-Toe, their only choices are lose or tie.

After completing the project, our professor told us that had we even made a working game that was  two human players, without a computer player aspect, we still would have gotten full credit, due to the vague requirement specification of the project.

I didn’t need the extra credit (I already had above 100% in the class due to all of the extra credit he offered) but I was bored and wanted the challenge, so I made my game unbeatable. I later ended up modifying it to give it 3 difficulties: Easy, Medium, and Impossible.

Difficulties
Easy simply picks a random spot to move into. If that spot is already taken, it generates another random spot, and so on until it finds one that’s empty and moves into it.

Medium checks to see if it can win, or if you can win. If it can win, it wins. If you can win, it attempts to block you. If neither player is in a position to win, it falls back to the random location.

Impossible uses a HUGE amount of nested if statements (72 if I recall correctly) (correction – the 72 nested if statements were for a different game. This one actually only has about 20 if statements for the computer logic) to make sure that either the computer wins or the game ends as a tie. You cannot defeat impossible difficulty. (At least, not that I know of. Feel free to try to prove me wrong when I release the app!)

Where I am Now
So far I have only begun work on this. I spent some time yesterday working on the initial user interface. It starts with a selection of 1 player or 2 players, if you select 1 player it takes you to a selection of difficulty.

After that, so far nothing happens. I haven’t even looked at my old code yet to start implementing game play.

I will begin working on this as well as Auto Respond, and will hopefully have a product available soon(ish)! (I still need to work on the graphics even. You know, the icon and whatnot.)

More Progress

Unfortunately, I wasn’t able to program at all this weekend. I wasn’t feeling well, and had a lot to do on top of that. (The hockey game sucked, but my brother’s gf threw him a surprise 30th birthday and that was fun.)

I did however get to do some programming last night. I was able to build in the optional text response. The former “Phone Options” menu is now called “Main Options”, and has the added option of “Respond to Text Messages”. This new option defaults on, as that is the main function of the app for the majority of users.

As I stated earlier, one of the three options on that page MUST be enabled… the app won’t let you leave the screen without having one of them enabled:

  1. Respond to Text Messages
  2. Respond to Calls
  3. Silence Ringer
One of those MUST be active, otherwise the app is basically useless.

In other news, I’ve squashed a couple more bugs (that I didn’t know existed until last night when I was coding):

  • Fixed a bug with “Silence Ringer” option
  • Fixed a bug with “Desk Dock Response Message” in “Dock Settings” screen
  • Fixed a bug which caused the “OK” button on the main settings screen to disappear on orientation change
These are documented in the full changelog, which is linked in the Play Store listing.
I still have a few things to finish before I release a new version. Here’s what I would like to accomplish before releasing a new version:
  • Add some more settings to schedules
    • ringer settings (silent/vibrate/app default)
    • response settings (respond to text/call/both/neither/app default)
  • Add analytics to Pro version
These are relatively small changes and shouldn’t take long to complete. I should be able to finish them up tonight.
I realize these are both changes that only apply to the pro version, but I don’t want to release the update to the free version prior to release an updated pro version. Also (as I did yesterday) I sometimes find, and fix, bugs in code that I’m not necessarily actively working on. So if I find such a bug while working on code for the pro version, I can fix it in the free version before releasing it.
Bottom line: a new version should only be a couple days away! 🙂