Takeaways From Creating My First IOS Mobile App

Sticking to the goals I’ve set this year I wanted to create a mobile app that even though small will add value to the users. I’ve been using similar existing apps that allow you to track the money you’ve saved so for a particular goal say for example a new motorbike, a vacation or a new house. Most of the apps have heaps of annoying ads and the pro version where bit overpriced IMHO. Scratching my own itch and being a software engineer that I am I studied how I can build my own app. Here are my notes and takeaways.

Key Learnings:

  • Download and install Xcode – grab it from the Appstore. Is the major tool for developing apps that run on the Mac platform.
  • Creating a
    • New Project
      • Choose a template for either iOS, watchOS, tvOS, macOS
    • Playground – allows to you write basic prototypes and quickly validate some of the standard classes and methods
  • Explore the User Interface – learn the basic shortcuts, customize fonts and preferences, use tabs, view documentation, create snippets
  • Start using Git as early as possible to get used to versioning your code
  • Based on the MVC design pattern – model is the database, the view is the UI and uses the controller to bridge the UI and model.
  • Learn the Interface Builder components – scenes, initial view, how to connect to view controllers, adding components to the scene
  • Learn pins and constraints – basically pinning an object to object or window on the layout
  • Learn how to compile and debug – work with schemas, use debugger, unit tests
  • Cocoa Touch classes – eg UITableViewController, UITableViewCell. Mostly extending the main UIViewController
    • Each class has its own stub methods implementation
    • Custom UITableViewCell
  • Using the First responder – is the current object receiving events, when using text fields you tell the object to resign itself so that it hides the keyboard.
    • You can also use events like touchesBegan when a user taps anywhere else and then call resign the first responder
    • Using delegates – events in the text fields can be handled by the main controller
    • on viewDidLoad
      • textField.delegate = self
  • Learn how to create UI elements using code – navigation menu, labels, buttons, etc.
    • using .frame, .center and CGFloat and CGRect for positioning elements
    • drawing and animating UI elements with CAShapeLayer and CABasicAnimation
  • Using Core Data – using manageObject and NSPersistentContainer to load data into the controller from your model
    • data modeling with attributes and relationships
    • creating, updating and deleting Core Data
  • Navigation controller – use for containers for view controllers that allows transitions from one another and manages the titles
    • learn segue, identifiers and how to pass data from one view to another
    • unwinding segue
  • Know the concepts of instantiating nil – basically, you need to check that a particular instance of an object is not empty and only then can you use it in your logic else your application will crash
  • AppDelegate – handle application-wide events
  • Using UICollectiionView components –
    • UICollectiionViewDelegate – selecting and highlighting collection view elements
    • UICollectionViewDataSource – provides data and views required for the collection view
    • UICollectionViewDelegateFlowLayout – can be used to allow horizontal scrolling
  • Using Notification Center – use UNUserNotificationCenter
    • creating notifications using DateComponents and Calendar
  • Human Interface Guidelines
    • App icons need to be pixel perfect for all device types
    • If you going to have a launch screen make sure that is consistent or the transition is not abrupt
  • You can develop apps locally and to start distributing or testing it on a device you need to sign up for the Developer Program.
    • I needed to be on the developer program(cost $ 100USD yearly) before I can test on a device. I couldn’t figure out how to do it without one.
    • If you need the company name listed on the app store instead of the individual then you need to be in the DUNS sytem during registration. If not you can still do register for DUNS after you signed up. DUNS registration is free and processing takes about a couple of weeks. After that, you can email apple to change your account from individual to a company account.
  • Certificates, Identifiers, and Profiles – used for preparing your app for distribution. Create one for development and another one for release to production for the App Store
    • Download the certificates and import it to your project and assign the teams
  • AppStore Connect – use to submit your app and what will appear in the App Store listing
    • on Xcode archive and upload the app
    • check all the required fields and create screenshots of your app for an enticing listing on the App Store
    • Watch out for typos. I was rushing putting the free version in and made a dumb mistake on the naming.

So that was in summary what I did and there is still a whole lot of area that I didn’t need for my MVP. Sure enough, will start incorporating some more functionality on the app on future upgrades like using iCloud and security then share how I did this here on the blog and on my youtube channel.

First Impression with Android SDK and Xcode

I am officially working on a WAMP setup with Eclipse as my IDE. I used a Mac before and setup was MAMP and IDE was Dreamweaver. Now I got a new MacBook Pro and I want to dive in mobile development.

So digging into Android and to iOS with their SDK and testing how fast I can easily pick up writing a Hello World app. Coming from a background of using Eclipse as my IDE I found developing on Android a bit easier. I downloaded the Android SDK loaded it to Eclipse, downloaded some API  packages and created a Virtual Device to demo my Android app. Language used is Java which I have some limited experience writing with on Apex( language used for Force.com). So I got the Hello World app running in a short time.

On Mac side the Xcode download is huge around 4 GB +, reason is that it includes all the libraries, samples and documentation, to get started fast I opted to use the one on the CD installer for Mac which has an older version of Xcode and still iPhone OS not iOS. Installation was quick. Writing my first Hello World though was not quick mostly because I am totally unfamiliar with Objective C but the development tools are fast unlike Eclipse which takes a bit of processing.

My impression is based on SDK, tools and the language.

For SDK I give it to Xcode. For the size of the download though is quite huge for XCode but with the Android SDK and AVD Manager you also need to download packages which eventually are quite huge downloads as well.
For IDE though its like XCode vs Eclipse, I find Xcode cleaner, faster and really better.  Even if I have been a long time Eclipse user, Eclipse sometimes lags while processing actions.

For the language this is kinda biased but I prefer Java as it seems more universal than Objective C.

But still working on learning both.

Getting into mobile development

Since I’m coming close to wrapping up one of my goals for these year which was  to get into a photography class and finally learn the ins and out. Moving forward on my own I need to learn next the different lighting techniques  which will mold my skill in photography further. I’m just waiting for the release of our certificates this month, I’m moving on to my next goal.

As one of my goals this year was to get into mobile development, I already own an Andriod phone an HTC Hero I bought last year to learn Andriod which didn’t really took off as fast I wanted to, today I bought my wife a 2nd hand Iphone 3G which I can actually use to demo apps that I would be building. I’ll be getting a 13 inch MacBook Pro next month March so everything will be in full swing by then.

For now I’ll be digging deep in the Andriod SDK, will post more soon.

Force Update your HTC Hero (GSM)

If you still haven’t received your update your HTC Hero (GSM version) for Andriod Eclair(2.1) from the stock Cupcake(1.5). Eventually the Andriod 2.1 update has been rolled out in the Taiwan, US, Asia and Europe. The update is over the air. Here is a trick I learned on how to force update it if you haven’t gotten the prompt yet. The trick is to adjust the date to a future date, maybe 1 month or 2 months further. This will force the phone to check automatically on HTC servers, within a few seconds you should get the prompt. There are a couple of updates, a firmware update and the Andriod Eclair 2.1 update. Download the first update and then the 2nd. Here are some shots I took while updating. Took me about an hour

BTW my HTC Hero was bought from Hong Kong so it’s default local is in cantonese after the update.

App Inventor for Andriod

Wow been awhile since my last blog post.

Saw this vid and looking forward to using it. Currently App Inventor is on beta and not ready for public. You can sign up and you would be notified soon by the App Inventor Team on its availability. In the meantime check out this vid.