Archive for the ‘whatever’ Category

self.brain->reset()

our brains need the time to reset just like the gadgets and computers we use and operate. by experimentation i’ve learned that a minimum of 2-3 weeks vacation twice a year pretty much does the trick. think about it, in today’s day and age we are always on, always connected, always tapping into sources of data to keep us engaged. from the moment we wake up and check our smart phone which aggregates data from multiple social and professional networks, to email, text and voice mail – we are constantly engaging with our peers, families and consume multiple sources of data, easily streamlined for our convenience, easily shared and re-propagated. and this is just the digital disturbance :)

the human story for today is our need to focus. the need to do just one thing at a given moment and stick with it for many hours. developers know how to do so (hey nir, can you turn off the music and ask andrew to put his headphones on please?). i know that for me playing music does the trick and specifically practicing yoga. calming the mind is an art that requires constant and un interrupted practice. i cannot imagine the brain enjoying 100% capacity at any given moment, just as much as it enjoys 0% capacity. the truth is pretty much always in the middle. face it, we have learned to respond to these interruptions better than focus, and it goes back to the days where the telephone was invented.

sleeping is the best time for the brain to not consume new streams of data and process all it has been bombarded with, make new connections and archive/store the data. from a quick survey with close friends and family, i learn that sleeping patterns are very much affected and do worsen with time. how many of you out there in the internets sleep with the TV on?

this is why i take two long breaks from my work and focus on relaxing my mind and body, explore new geographical areas of our planet, meet new people, study a new language, and more often then not play/write music and expand my photography skills. this works in phases though and i find that it takes some time to re-adjust the mind and relax – slow down. the longest break i have ever taken from life was a 3 months trip to brasil. no iphone, no laptop, no internet connection. would you be surprised if i told you that it did not take long to re-adjust to the new situation and that i loved it? i took my best photos and wrote my best music while taking these breaks from life.

much like a hard reset, browser cache cleaning and the application of a new style sheet – one may immerge back with fresh energy and a newly re-wired brain. so – for the sake of your career, mental health and own happiness – plan on taking a longer time off. you deserve it.

 

iPad 3 predictions

the ipad3 is around the corner as apple just announced a media event on march 7th.

ipad3 event invitation what will we possibly get?

  • retina display: 2048×1536 pixels will make pretty much everything more gorgeous and engaging.
  • A6 quad core processor: this means tremendous performance and response boost.
  • LTE support. let’s face it – 4G network is where it’s all heading,
    as the internet will blend better and tighter with the device and our lifestyle.
  • better front and back camera. flash.
  • equal or better battery life.
  • unified GSM/CDMA support.
  • bluethooth 4.0 chip.


what we may get:

  • smart bezel virtual buttons:
    imagine the bezel and back cover of the ipad responding to customized buttons which lit up.
    so you can setup the top left .bezel button to launch maps. more here.
  • NFC chip (not likely IMHO).
  • airdrop feature from ipad to mac.


what we probably won’t get yet:

  • haptic feedback display. the game changer. it will be a great day when it arrives (though the image from apple may hint at it…).
  • solar charging of the device
  • new map system which apple has been working on

final thoughts:

  • how does siri fit in? i am not sure yet…
    will iOS 6.0 be announced as well? if so, developers will a beta by early next week…
 

from: iphone -> ipad; a quick guide.

it’s time to expand your iphone app and introduce it on the ipad. that is an interesting move for any product as the ipad is not an iphone – it is used for different things at different circumstances. yeah – you are going to practically re-think your app… which is great because you get to revisit your code and make sure your pipeline is tight, secure, fast and reliable. all that with the elegance of the ipads – split view controllers

where do one starts? well, you can start be designing your app for the ipad and take by thinking about the following:
orientation, layout and gestures. all of which vary significantly from the iphone (unfortunately). side note: one thing i really like about webOS is that you develop your mobile app once and the system takes care of adjusting the interface to a slated device.

next thing to learn about the ipad is it’s split views, popovers and specific hardware features – all of which are ipad unique. you will need to use conditional coding to learn if a specific hardware feature you are looking for is available. this is necessary as you will need to load the right resources to handle that hardware. more specifically one should write conditional coding for:

resources: in your code, recognize which platform is running and load the right nib files. you will also need to load the right graphics that match the screen size and resolution.
classes: check for class availability based on the device you are running on as some are iPad/iPhone specific.
methods: weak-link any device specific methods and perform a check at runtime for the availability of that method and wether the object responds to a specific selector.

hardware: test for cmarea/gps/gyro support before utilizing it.

okay – we are done with the overview. let’s roll up our sleeves and dig right into it.

first thing’s first – lets let xcode help us start the process by duplicating the current target (an iphone target) into an ipad one.
right click on your target and choose “duplicate”. two options here – duplicate only and duplicate and transitoin to ipad. let’s go with the later.
what xcode does here is create a new virtual folder (i.e. group) called “Resources-iPad” and copies the main nib file there. xcode really takes care of the main nib file and creates it for us. no other nib files to be touched. why? because the rest of the nib files are usually tied right into apps view controller so xcode leaves it up to us to define both the view and it’s controller. xcode sets the targeted device family (TDF) build settings to iphone/ipad and modify the base SDK of the project which will support both device types. no need to touch nor worry about the deployment target. you will see a new plist for the ipad app with it’s relevant settings.

in order to see it in action – run the app using the ipad simulator. what you will see is the iphone app running inside the ipad simulator and you can x2 time it to fit. boooo. one more step necessary (thanks apple for leaving it up to us) is to update the scheme to use the new and shiny ipad target. so go ahead and duplicate your iphone scheme (or create a new one) and under run  - choose the ipad executable. boom. wait – it really looks bad here.

well – as you may know iOS uses the MVC design pattern heavily. you may not know that MVC is actually a compound design pattern which includes 5 patterns. luckily this abstraction makes the process of porting an iphone app to an ipad a bit easier, as potentially one needs to take care of the view – making sure the right outlets are updated based on the design of the UI, and also heavily touch upon the controller to see which device is used and then follow a specific code path to match. the good news is the model can stay untouched :)

if you are happy with the IBOutlet you currently have on the iphone and would like to only use those (i cannot image why, but yeah…) all you need to do at this point is adjust the springs and struts in the size inspector when loading up your nib in IB. you should also make sure to support the orientations required for the app. in order to do this you will need to  implement shouldAutorotateToInterfaceOrientation:  and test for the device running the code and allow rotation. if you have singleton object place this code in it’s header file:

#define IS_IPAD   (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

ipod touch returns UIUserInterfaceIdiomPhone. FYI.

or place it wherever works for you, as long as you have access to this macro from wherever. this is useful as you will need to update your controllers to test for the hardware running and follow a specific code path to update your view and outlets.

one example of using this code and auto rotating is this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

	 if (IS_IPHONE)
	 {
		 if (interfaceOrientation == UIInterfaceOrientationPortrait ||
			 interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
		 {
			 return YES;
		 }
	 }

	 if (IS_IPAD)
	 {
		 if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
			 interfaceOrientation == UIInterfaceOrientationLandscapeRight)
		 {
			 return YES;
		 }
	 }

	 return NO;
 }

pretty easy and straight forward right? moving along.

cautionary tale:
the app now must be careful with the symbols it uses. if you want to use UISplitViewController while running on iOS 3.1 – your app will crash as there are no split VCs on 3.1.
the way you should be thinking about this is by mentally tuning into the ‘runtime checks’ zone, where you will test if a particular symbol exists. more about that later.

updating VC and views:
this is where the bulk of the work really is – redoing your views and adding code (or creating new) view controllers. what can we do – the view size varies between the iphone and the ipad and that certainly needs to be taken into consideration. so start off by redesigning the views for the ipad. if you plan on scaling the existing view could work okay, but more often than not will not be the result you are hoping for. think of it this way – the new ipad interface should make use of the new available space and the elements which only exist on the ipad (splitVCs and popovers for example). the outcome is good UI and top UX.

also consider the following. for view controllers:
a) create new nib files for each device (if you use nib files that is).
b) if you code your views – make sure you support both devices when you do so.

for views:
a) if you override drawrect: make sure the method can draw to different view sizes.
b) if you implemenet the layoutSubviews method, the code must adapt to different view sizes.

symbol checking during runtime:   if deep down inside you had hoped that this step will somehow be avoidable – fear not :) runtime checks for newer symbols is easy as pie and is the type of topic you can discuss with your boss and sound really clever.
all of this is under the assumption you support different versions of the OS. just like a good soldier – you MUST protect your code from using symbols that do not exist. this happens all the time when you update an app to use new features and want to continue to support previous versions running on older OSs. all you need to do is create different code paths to follow, based on the OS currently running on the device executing your app. if you don’t do that your app is guaranteed to crash and that is not something us pros do, so let us quickly look into an example of how one goes about creating a code path when checking for newer symbols during runtime:

if you are linking against iOS 4.2 you are in luck my friend. that version has a weak linking support built right in, which allows you to check for the existence of a given class object and determine if it’s usable to you. like so:

if ([UIPrintInteractionController class]) {
   // Create an instance of the class and use it.
}
else {
   // The print interaction controller is not available.
}

seriously now – how simple was that?
bare in mind that if you want to use this feature of the OS you must build your app with LLVM and Clang.
deployment target should be 3.1 or later. sorry.

if your app links against < 4.1, use NSClassFromString to see if a class is defined. if nil is returned – you’re shit out of luck.

for example:

Class splitVCClass = NSClassFromString(@"UISplitViewController");
if (splitVCClass)
{
   UISplitViewController* mySplitViewController = [[splitVCClass alloc] init];
   // Configure the split view controller.
}

for testing if an object  can be sent a specific message (i.e. has implemented that method), use the oh so convenient instancesRespondsToSelector: class method (yes, it is a class method, it’s not a type).

if you are a registered iphone developer and have not done so – check out the SDK compatibility guide by apple.


runtime checks –> conditional code paths:
based on the interface idiom described earlier – let’s start creating cool code paths to support both devices. a simple if-else statement will do just fine thank you very much. moving right along.

This concludes this first steps required to port your app from iphone to an ipad. next is a quick rundown on how to use split view controllers in your ipad app.
 

 

what i’d like to see in the iphone5 (and probably won’t)

Good chance of getting:

- 4G LTE: 100Mbit up, 50Mbit down (peak). this will be huge for everyone. streaming made easy, uploading live videos and pretty much change the rules of the game when it comes to utilizing the phone. the big question is – can the carrier(s) handle the demand?

- HD front and 8MP rear camera with a dual flash system. HD facetime – thank you very much. better photos at low light condition? yes please. no doubt apple will introduce major improvements to the camera, both hardare and software. by now the iphone is the most popular camera on flickr and it’s growing fast. we want to be able to take better photos easily, at different conditions and share them quickly. as the pixel count rises so the demand for bandwidth (see 4G LTE) and a quick turn around for large file sharing. we can ex (cpect something unique with this feature’s new offering. the inherit problem is the small chip for the camera and it’s ability to shoot in lower light conditions.

- wider screen: has been rumored for a while with some fake prototypes etc. can’t wrap my head around a wider screen unless it’s up to full HD, which will be, no doubt, incredible (i’ll rate this as 1% chance of happening). if i’ll have to guess it will be retina 2.0 with a slightly higher pixel density and a more crisp display than the current 960 x 640 at 326 ppi.

- better battery life: with iCloud and push across the board, there is no doubt apple is pouring tremendous effort behind making their devices stay up and running longer. expect something unexpected.

- built in noise cancelation mic: a la jawbone, it’s time for the iphone to become a better phone. and please let’s take care of the proximity sensor issue. please.

- NFC with eWallet OR BLE (4.0) + APIs: this will be very exciting to have. finally. eWallet patents are around for a while and android is a head of the curb. if we look east to japan we see clearly how mobile is used and credit cards are gone. yes – gone. the phone will be THE payment system in the very near future. it’s the credit companies that should be on their toes with this one. it is really all a matter of timing no? can’t enter too soon and definitely not too late.

there has been much discussion over Bluetooth Low Energy, otherwise known as BLE, which is the 4th version of bluetooth, now available in the just released macbook airs. what the new standard means is low energy consumption and wider range (50m) which means awesome apps and peripheral devices are heading our way. this is an interesting strategic call by apple, do they go with NFC and RFID or do they bet on BLE? based on the this recent move of incorporating BLE chips within the new line of macbook air… well… let’s see what happens :)

Little chance of getting:
- solar charging: apple has been working on this for a while now. heck, there is a prototype out in the wild that is solar enabled (link). this is a game changer and the reason why there’s little chance of getting this one is because it’s probably required to perform much more tests and phase out gradually. maybe a device which combines both battery and solar charging a la hybrid first.

- haptic display + APIs: probably the advancement i would like to experience the most. haptic displays will revolutionize the way we interact with smart devices and their touch screen as they provide feedback to our touch sensory system. imagine that each button you click on a touch screen feels real. this is huge for UX across the board and opens the doors for some unique applications. android has immersion – a great company to follow with a great mix of products, worth mentioning are their medical related haptic devices. check it out here.

- new map application: apple has made significant moves to become a player and tighten their vertical integration. this app should be nothing but fantastic and introduce features never seen before on smart devices. one option could be an augmented reality turn by turn navigation, integrated with location meta data and the users social graph.

 

iOS 5 is around the corner (updated)

iOS 5 image

update: this post was written thursday of last week. it is now semi confirmed the developer of mobileNotifier is hired by apple and that iCloud will be presented by jobs tomorrow.

one major revamp is the bare minimum as there are areas lacking where either android or cydia leaves the current OS lagging. and no doubt we will get what we are expecting.. just a gut feeling… here is my short list of enhancements that i’d like to see:

1. improved notification system: bar non that most important and required change to iOS. face it, the current notification system sucks big time. in the past, the real incentive to jailbreak your phone was mywi, my3g and going even further back, multitasking and naturally the most important feature – sim freeing your phone (Screw you apple and ATT for violating FCC regulations). now-a-days, mobileNotifier is THE reason why my phone is jailbroken. aggregate all notifications into a single window utilizing the empty space created when you double click the home page. apple – pls take note, this guy has done a great job.

2. dynamic home icons: ala windows8. yes you heard right. big chunky icons that actually display content and not just a static image. one good example is available on cydia and is called ‘weather icon’. it changes the degrees on the weather icon to display the current temperature. it also allows the temperature to be displayed on the status bar. really useful stuff. apple, please expose an API to do so.

3. OTA updates: not likely but definitely nice to have… over the air updates makes lots of sense. please – no more plugging in to itunes and backing it all up. this ties up to the next item that is most definitely making an appearance on monday:

4. iCloud content sync: this will probably make a big eco. iCloud can and will take cloud services to the next level. apple doing what they do tiered up, may see music sync and later down the road app sync.. so iCloud will probably allow you to purchase music from iTunes and stream it directly from your cloud storage. no need (or an option) to download and sync stuff. fantastic. one viable option is to open a US front against spotify, the EU-stream-the-song-you-want kind of service in the US. imagine a yearly/monthly plan ($20-$50/year) where you can listen to what you want… that’s a nice one.

WHAT’S MISSING? iphone5 with 4G, NFC and iWallet, A5, double down on RAM, larger display and IR.