Tag: Mobile

Programming Stuff

iOS/Android/VisualStudio/C#/Xamarin – It’s Looking Up

As you may know, I began digging into Xamarin at the end of last year. It showed a lot of promise as a great way to create cross-platform iOS and Android apps leveraging the existing Visual Studio and C# skills that so many developers have.

When I first started working with it, I did have some initial concerns as I talked about in these 2 blog posts.

I have to say though, once I got past those initial hurdles, things are definitely looking up.

So far I’m doing mostly basic stuff but overall things are going well.

My two main issues are

  1. Visual Studio seems to occasionally have difficulty attaching to the iOS build server
  2. The Visual Studio Android UI designer doesn’t work as well with RelativeLayout as Android Studio does

Neither of these are show-stoppers though.

In the case of connecting to the iOS build server, in most cases restarting Visual Studio takes care of the problem.

For the designer, the Visual Studio designer is workable and if I want to, I can use the Android Studio designer to do the layout work and then just copy it over to the Visual Studio project.

So that’s a long way of saying…

Using Xamarin within Visual Studio is getting a thumbs up so far.

Keep watching as I push on it harder to see how it does as the problem complexity increases.

If you’re interested in doing iOS/Android development with Xamarin, Part 1 of my Pluralsight course series on the topic just went live today…

CrossPlatformiOSAndroidVSCSharpPart1_WithLogo

Programming Stuff

Creating Dynamic UI with Android Fragments gets 5-Star Review

I’m not big on self-promotion but I’ll make an exception as this is an exciting day for me…

My book Creating Dynamic UI with Android Fragments received its first user review on Amazon and its a 5-Star Review

This book is just what I was looking for. The three pieces I was having issues with were static vs. dynamic fragments, dialogue fragments and backstack management. This book covers all three of these in a manner that has really cleared up my understanding and improved my application design as a result.

Thank you to kbp135 – Here’s the link to the review.

And just in case you’re wondering … the reviewer is not someone I know 🙂

Checkout Creating Dynamic UI with Android Fragments for yourself. I’d love to hear your feedback.

Creating Dynamic UI with Fragments

 

Also checkout Jim’s Android courses at Pluralsight.

Jim's Android courses on Pluralsight

Jim’s Android courses on Pluralsight

Programming Stuff

Android Developers Earn More Money than iOS Developers

According to recent data, senior Android developers average $131,000 per year versus $121,000 for the same skill level on iOS.

That’s some pretty serious cash!

So what are you waiting for … clearly, it’s time to get your Android skills tuned up! 🙂

The full story is available in this Tech Week article.

Checkout Jim”s Android courses on Pluralsight.

Jim's Android courses on Pluralsight

Jim’s latest book, “Creating Dynamic UI with Android Fragments” is now available on amazon.

Creating Dynamic UI with Fragments

Programming Stuff

Android for .NET Developers Series Complete!

Part 4 of my four-part series on Android programming for developers with a .NET background just went live today.

UnderstandingTheAndroidPlatform_WithLogo

 

This course delves into the unique features of the Android platform and how those features and the related components affect the way apps are created.

I hope you’ll check out this course and the whole series if you haven’t already seen it. I think you’ll be happy you did.

Here’s the complete series

Part 1: Getting Started

Android for ,NET Developer Series: Getting Started

 

Part 2: Building Apps with Android Studio

Apps with Android Studio

 

Part 3: Adopting the Android Mindset

AndroidMindsetBanner_WithLogo

 

Part 4: Understanding the Android Platform

UnderstandingTheAndroidPlatform_WithLogo

Programming Stuff

How to Clean an Android Studio Project

You’ve probably noticed that Android Studio doesn’t have a “clean” menu option. But we know that, like any build environment, there are intermediate files created that we may want to occasionally remove.

It turns out the solution is the command line. Simply open a command line in your project’s root folder (Usually named something like MyAppProject) and run the following command

gradlew clean

You’ll see something like this…

gradlew_clean

Notice that you get a bit of an unexpected message, “BUILD SUCCESSFUL”. This simply indicates that it has gone through and successfully cleaned out the intermediate files. I’ve found that when dealing with larger projects its not uncommon to reduce the amount of disk space used by the project by 70% or more.

So a bit of an unexpected solution (especially for those who’ve been in a Windows environment for a long time) but an easy one.

To learn more about Android programming, checkout Jim’s Android courses on Pluralsight.

Jim's Android courses on Pluralsight

Jim’s latest book, “Creating Dynamic UI with Android Fragments” is now available on amazon.

Creating Dynamic UI with Fragments

Programming Stuff

Creating Dynamic UI with Android Fragments … or…

What I did on my Summer Vacation 🙂

Creating Dynamic UI with Fragments

It’s been a crazy busy Summer. Since May I’ve released 3 new Android courses for Pluralsight with a 4th coming out in a few weeks and wrote a book on Android Fragments titled Creating Dynamic UI with Android Fragments.

I’m excited to announce that the book just became available for pre-order today!!

I need to take a minute to thank my beautiful wife, Bonnie. As you might imagine, I’ve been putting in a lot of hours these past few months and would never have been able to get through it all without her. Her patience and support never end. Bonnie I love you!!

My life is so blessed, I can barely believe it.

Programming Stuff

Switch to Android Studio 0.2.0 a little bumpy

Android Studio 0.2.0 update … encountering issues with both new AND existing projects.

I’m fortunate that  using the latest and (sometimes not so) greatest is actually my job. With that I’ve been able to heavily use Android Studio ever since it was first released. To my knowledge, I’ve installed and heavily used every public update since the release.

Everyone of those updates went pretty smooth … until this one.

The switch to Android Studio 0.2.0 has, by far, been the bumpiest upgrade yet. After installing it…

  • I can’t generate new projects
  • I can’t build existing projects.

Not much I can get done without being able to do one or the other. 🙂

The good news is that resolving these issues was pretty easy.

Can’t generate new projects

This issue appears to be specific to folks using Android Studio on Windows.

I initially let Android Studio handle the install as I had always done previously. Once the install completed, any attempt to create a new project resulted in the following error…

CantGenProjectBadDependencyMSg

Basically, the message indicates that Android Studio can’t find a dependency.

The solution turned out to be that a fresh install is requried ….

  1. I exited all instances of Android Studio
  2. I changed the name of the existing installation folder
    • The default installation folder is
      C:\Users\[user name]\AppData\Local\Android\android-studio
  3. I then downloaded and installed the latest Android Studio installer

And that took care of the problem

Can’t build existing projects

This turned out to be a two-fold problem for me.

The first issue has to do with a fairly well documented change that’s been made to Android Studio. They’ve changed to a new version of Gradle that’s not backward compatible. As a result an attempt to build a project that was created with a prior version of Android Studio shows the following error.

GradleBuildIssue

The fix is to change the version of Gradle that’s referenced in your project’s build.gradle file (located in top-level of project folder). If you click on the “Search in build.gradle files” link in the above dialog it’ll open the build.gradle file for you. Or you can just open the build.gradle file yourself. It’s quite small and easy to navigate.

To fix the problem simply change the line that reads

classpath ‘com.android.tools.build:gradle:0.4

to

classpath ‘com.android.tools.build:gradle:0.5.+’

This will cause Android Studio to use the required version of Gradle.

But trouble continues…

With that fix made, I would then get an error indicating

FAILURE:Could not determine which tasks to execute

The problem is related to extraneous entries that were added to the [ProjectName].iml file (in your project’s top-level folder) by earlier versions of Android Studio.

To fix the problem, exit Android Studio and open the [ProjectName].iml file in an editor and delete the entire component element with the name “FacetManager”.

This changes the file from…

<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="GRADLE" type="JAVA_MODULE" version="4">
  <!-- *** Remove From here *** -->
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":" />
      </configuration>
    </facet>
  </component>
  <!-- ***  To Here   *** -->
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
      <excludeFolder url="file://$MODULE_DIR$/build" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

to

<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="GRADLE" type="JAVA_MODULE" version="4">
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
      <excludeFolder url="file://$MODULE_DIR$/build" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

And with that … SUCCESS!!  … I’m now able to build the project without difficulty.

Wrap Up

So the cleanup isn’t too difficult but does require some work. If you’re encountering issues other than those I’ve mentioned above the Android Studio folks have posted a couple of helpful pages addressing a variety of issues

To Learn more about Android programming, checkout Jim’s courses at Pluralsight.

PSAndroid_216x155

Programming Stuff

Android “Master Key” Security Patch Check Available

Odds are that you’ve heard about the security hole that was found to exist in virtually all Android devices that would allow someone to take control of the device.

The good news is that Google has created a patch for the issue and sent it to OEMs. The challenge always comes down to the OEMs getting the patch distributed to our phones and, as always, that is taking time.

It turns out that we can all check to see if we have the patch installed thanks to Bluebox (the folks who discovered the problem) releasing a free app that will check your phone to see if you have the patch.

Although the app is not able to apply the patch because that’s up to the OEM of your device you can at least know where you stand and if you are so inclined start complaining to your carrier that you’d like them to work with the OEM and hurry to get it distributed.