Today, one of my friends asked me how to select photos from gallery and upload it to server in iPhone. I think it is much helpful to write a tutorial with example source code, instead of asking him to google the solution. To make sure that my example works properly (it always works properly though), I will write a server side function which accepts the upload images. The server side functions will be implemented by PHP, a very simple script language. After that, I will write another tutorial for upload images from gallery or camera in iPhone and iPad.
Read more
Build Android App and IOS App with Backbone and Cordova
Most of the companies wanna to create both Android app and iOS app to cover all mobile device visitors. To save effort and time, many companies try to choose hybrid development which can create cross platform apps. The ideal result is coding once and running anywhere. Currently, there are several frameworks to help people create cross platform app, such as Cordova, Adobe Air, IONIC. The best advantage of hybrid development is that we can use HTML5, CSS and Javascript to build the native app for Android device, iOS device, Windows device, etc. Of course, not every framework use HTML and Javascript to implement the cross-platform.
Read more
Change UIAlertView After IOS 8
UIAlertView is deprecated in iOS 8 and later. Therefore, we need to use the latest API to show alert view. To make the code more compatible, we can check the system version and implement the alert view basing the iOS version. Here is the example source code I am using:
Read more
Two Ways to Download Images in iOS
Downloading images is a very common task in both iOS app and Android app. In Android app, there are several ways to download image by url. It is the same in iOS. Here I will demonstrate two ways to show you how to download images from internet in iOS app. Depending on your real project, you can choose one of the solutions.
Read more
Two Ways to Convert JSON String into NSDictionary
JSON is a very simple format for HTTP transaction between app and backend server. Currently, most of public API return data in JSON format, such as Google API. In IOS, there are several ways to convert the JSON String into Object-C object. Usually, the JSON data will be converted into NSDictionary object. Here are two pieces of example source code to convert JSON data into object in IOS.
Read more