Category Archives: Android

Euchre Conversion to Android

I just started converting my Windows Euchre game to an Android app, and there’s already some things I miss about C#.

  1. Operator overloading
    1. In C# I can create functions to overload the =, ==, <, >, and other operators, so that I can do things like if(card1 < card2)
    2. In Java I have to create functions like .set, .equals, .lessThan, .greaterThan, etc. So I have to now change all of the == to .equals in my code, and so on with the other operators. Now I have to do if(card1.lessThan(card2))
  2. set/get Functions
    1. In C# I can do something like this:
      public string name
      {
          set
          {
               this.m_name = value;
           }
           get
           {
               return this.m_name;
            }
       }

      Then access the variable like this:

      player1.name = “Randy”;
      and
      name = player1.name;

    2. In Java, I have to create 2 functions, setName, and getName, then have to access like this: player1.setName(“Randy”); and name = player1.getName();
  3. Native Data Types: This one I’ve run into before while programming with Android/Java… native data types have different names in C# and Java. And I’m so used to using C/C++/C# that I often find myself using the wrong name.
    1. In C#, true/false values are bool, and text values are string
    2. In Java, true/false values are boolean, and text values are String (capital S)
      1. This is because (as I explain in more detail in #5) strings in Java are objects, whereas they are a native data type in C#.
  4. Naming Convention
    1. In C#, generally variables start with lowercase letters, and functions and classes start with uppercase letters
    2. In Java, generally variable and functions start with lowercase, and only classes start with uppercase.
  5. String comparison: Because there is no operator overloading in Java, and strings in Java are actually objects not a native data type, this is different too
    1. In C#, I can say if(string1 == string2) and it will compare them.
      1. This is partly because strings are a native data type in C#. But even if they weren’t, you would have the ability to override the == operator.
    2. In Java, I have to say if(string1.equals(string2)) to compare them
      1. This may not seem like a big deal, but doing string1==string2 is legal, and a valid statement, but it likely will not return the result you are looking for. This will check to see if the two variables are in the same memory location, NOT whether or not they contain the same information.
These things may not seem like a big deal to someone who is not doing the programming. A few extra letters here or there, some difference in lowercase vs uppercase, some extra functions here or there… 
But when you’re dealing with literally thousands of lines of code which need to be translated from one language to another, this is a big deal. And testing is going to be a big deal too, because I’m sure that I’m going to make some translation mistakes somewhere. 
Luckily the IDE I’m working with is VERY good at pointing out possible logic errors as warnings (like the string1==string2 thing) so that will definitely help. But this may take a while, as I expected.
And although the IDE is good with logical warnings, #4 becomes a problem with this IDE because the auto fill function in the IDE is case sensitive. So if I am looking for player1.getName() and start typing player1.GetName(), the auto fill will not find getName(). (Or if it does find it, it will take a while to find it.)
Sorry for the rant, I’m just not a fan of Java and never have been.

Auto Respond 1.2.9.9

This daylight savings time thing has been a pain for WAY too long, and I think I’ve finally got it figured out for everyone.

This release is for the pro version only, as it fixes an issue with schedules. If you are still having problems after downloading this update, PLEASE let me know. (I don’t really want to deal with this issue anymore, but I will if it’s still broken.)

The issue (so you know what to look for) is that when you choose the time for your schedule, the previous screen would show a different time. For example: in the time picker (where you choose hour and minute), if I chose 8:30, the text telling me what time the schedule was for (in EDT) said 7:30 instead of 8:30. In some areas (like GMT) it would show 9:30 instead of 8:30. There was also a problem in Alaskan time (AKDT/AKST).

This should now be fixed for all time zones, and all possible DST configurations. If it is still broken in your area, let me know and I can look into it further.

Market comments :-)

With a new update to Google’s systems a couple days ago, I can now comment on reviews/ratings that are left in the market!

This is great, because there are a couple of reviews which are requesting features that are now available in newer versions, and I can comment saying that the feature has been added. Also, I was able to leave an explanation to the one negative comment I received, and hopefully people will see my comment and realize that the negative review was left due to user error, not an error on the program’s part. (I also said to email me if there are still issues with that review.)

The only thing I’m not sure of, is if the user is alerted that I have commented on their review. This would be nice, because it could cause some users to then update their review to reflect the comments that I left.

If any of you left a review which I commented on, let me know if you get a notice of my comment. 🙂

Auto Respond 1.2.9.7

Another small update, this one thanks to a user drawing my attention to an issue.

If you are using the paid app and have schedules set, open your schedule view and look at the times of the schedules. They may be an hour off in one direction or the other. Mine were showing an hour prior to the scheduled time, my user in England was showing an hour after the scheduled time.

After doing some thinking, and some looking into the issue, this seems to have been caused by daylight savings time. So, if you are using the paid version, there is now a time adjustment for daylight savings time when displaying the start and end time of the schedules.

As usual, a fix has been pushed to the Play Store, but it may not be available immediately. (This update only applies to the pro version, not the free version.)

Auto Respond 1.2.9.6, Tic Tac Toe 1.2.2

I did some more digging into Google Analytics, and found that the crash in Auto Respond was occurring on tablets. All 3 crashes were on a tablet device.

With that said, I’m not sure why anyone would even be using Auto Respond on a tablet so I was a bit confused. Plus, just for kicks, I ran it on my Nexus 10 with no issues, which confused me further.

I was, however, able to recreate the issue on a 7-inch tablet in an emulator. The issue is that a 7-inch tablet failed my check to see if the device is a tablet, and it loads a layout over top of the existing layout – which causes a crash on a tablet settings screen layout, which is why I have that check in the first place.

The good news is, since I used the same code in my Tic Tac Toe game, this avoids an issue if THAT is used on a 7-inch tablet (which is something that is very plausible)

So all 3 apps have been updated (Auto Respond – free and pro, and Tic Tac Toe) to a version free of crashes, and a few minor other updates in each.

These changes have just been pushed to the Play Store, and should be live in a couple hours.

Auto Respond Crash

I’ve noticed in Google Analytics that there is still a crash bug in Auto Respond.

From what I can tell, the crash seems to happen when moving from the settings menu, into the “Main Options Menu”, and it has only occurred on Android 4.0.4. I has happened in both the free and the paid version, but only a total of 3 times.

I do not have a device running 4.0.4, and my Galaxy Nexus running 4.2.2 seems to not crash when I run it. I created an emulated 4.0.4 device, and still cannot recreate the crash.

If you have a device running Android 4.0 or higher, can you please try to recreate this crash and send me a crash report? As I said, the crash seems to be happening either in the settings menu, or the Main Options Menu, or when transitioning between the two screens.

Crash Reports

I know I’ve been asking for crash reports when Aut Respond crashes. But here’s the thing: If you send me a crash report, please make sure you’re running the latest version of the app. If you’re not sure, go into the Play Store after experiencing the crash, go to “My Apps”, and see what updates are available. (Again, you should do this with ANY app that crashes or has bugs.)

I received a crash report this morning from someone who is using 1.2.9.3. That’s 2 versions old, and it was replaced to fix the very crash that this person is reporting.

1.2.9.5 has been out for over 3 days, and (according to Google Analytics) still has not experienced a single crash. Therefore, if you aren’t using the latest version, it would be beneficial for you to update. The current version is very stable, and has all of the features of any of the previous versions. (And depending on what version you are running, it may have MORE features.)

Auto Respond 1.2.9.5

One more bug fix. This time something that I noticed before, but I wasn’t sure what caused it. At the time I thought it may have been because I was using an emulator, not a real device. Turns out I was wrong.

Here’s how to replicate the issue: If you add a contact to the “Do Not Respond” list, or the “Custom Response” list, and that contact doesn’t have a phone number listed, the program will crash.

Just like the last crash, I saw this crash on Google Analytics and looked into it. It took me a bit to figure out what exactly was causing it, but I got it fixed up. If you try to add such a contact in the new version it will not crash, but it will display a toast notification alerting you that the contact needs to have a name and a mobile phone number listed.

The error was caused if NO phone number was listed, but I made the warning appear even if there was a number listed and that number was not a mobile number. This is because  the app checks to see if it’s a mobile number before replying. (This check is actually only done for the phone call response. If you are receiving a text message, the app assumes the number can receive a response message.)

So if you try to add a contact to either of these lists and get that error, make sure that the contact has a mobile phone number and that it is listed as a mobile phone number in the address book. If it’s listed as anything other than a mobile phone number, it will display this warning and will not add the contact to the list.

Auto Respond 1.2.9.4 – More Bug Fixes

Crash Fixes

More crash fixes in Auto Respond… this time, only in the free version. (Sorry again guys! At least that’s good news for those of you who have paid for the app.)

I obviously don’t use the free version for my personal use – since the paid version has more options. I try to test everything possible in both version of the app before releasing a new version, but sometimes I miss things.

As it turns out, entering into “Notification Options” or “Other Options” on a 4.0+ device would cause the app to crash.

I only noticed this because I checked Google Analytics for crashes and exceptions, which listed a few crashes in the free app. This once again leads me to beg you guys to please send crash reports when they happen!

When the app crashes, you get a prompt that ways “Report” and “Close”. PLEASE click “Report”, even if you leave the text box empty. It would be preferred if you would put a small note in there, including what Android version you are using, and/or what device you are using (Android version is more useful) and maybe a small description of what you were doing when the crash occurred.

Without this report, I was only given a few pieces of information:

  1. What app it happened in
  2. What file it happened in
  3. The error code
With the error reports, even if you do not put in any additional information, I get one more piece of information which is VERY useful: the exact line number which caused the error.
Other Bug Fixes

While I was searching frantically for this error, I happened upon another bug. This one applies to both free and paid users.
It was a small bug with how the “Silence Ringer” option works. Nothing too big, but it fixed a couple of issues for users on Android 2.x, and another issue for all users. 
Bottom Line
A couple more bugs squashed, and the new version has been published. As always, it may be a couple of hours before the update is live in Google’s servers, but make sure to look for it later tonight!

Settings menu update

I just realized that the Android support library was updated in November to include support for PreferenceFragment. (I knew it was updated, but I just now realized that it included that class.) Now, I know that means nothing to most of you… but to me, it means that I can stop creating separate menus for Android 2.x and 4.x!

This means a few things:

  1. The file size for the app is likely going to get smaller, because I can get rid of a lot of redundant code.
  2. I can stop using depreciated code, and start using the supported replacement code.
  3. There’s less of a chance that I will change/add something in one place, and forget to adjust it in another place.
  4. I am going to have to figure out how to use it properly, and where I need to make the changes, which may take some time
  5. There will likely be another update soon which will probably improve performance, reduce the size of the app, and hopefully make it easier for me to release future updates more quickly.
Again, this may not seem like a big deal to you guys… but it’s a big deal for me!

EDIT: I think I may be wrong on this… it looks like the support library includes Fragment, but not PreferenceFragment. 🙁