Posted by: Tharindu | December 31, 2013

Cricket365 Australia iPhone app for Aussie Cricket Fans

After Cricket365 Sri Lanka initial app, I have worked on the next Cricket365 iPhone App on my free time for Australian Cricket Fans with the help of my friend Julian doing a super looking design. With a beautiful customised iOS7 new look Cricket365 app would be handy to Aussie Cricket Team lovers to get instant News, Videos, Images, Live Scores on their loving Cricket Team. Additionally, Aussie fans can now listen to ABC Grandstand Sports Radio Live Commentary and broadcasts within the app.

             3      4      5      

I’ve been in love with Cricket for number of years since my early school days. And I also felt in love with iOS and mobile development started from my university days. Ever since, then I had this idea of making an app for stay updated with Cricket specially for Sri Lankan Cricket Team. For my idea to become reality my friend Julian made a super design some months back for this new idea after Sanhinda app we did two years before for LiteDreamz. And finally, after working for number of months on little spare time I got I was able to submit the app for Apple AppStore. With Cricket365 – Sri Lanka app you could check out Live Scores, Image Gallery, Sri Lanka Cricket Official Youtube Feed Videos, News from CricInfo, Home Page with Key victories for Sri Lankan team, Update Twitter, Facebook status from within the app and you could also share Videos, Images in App.

                                    

Last few months were so much interesting being part of a great team working with an app for RebelMouse. My university colleague Kasun introduced me to the RebelMouse CEO Paul Berry (former CTO of HuffPost) and CTO Nike Gurin-Petrovych in early February this year. After being in trial for two months, I was privileged to be a full time rebel joining this talented team, working from worldwide. From June, I started working full time with a very talented developer Andrey from Ukraine on making this exciting app. RebelMouse iPhone App got continuously improved with comments from all team mates everyday before we have this exciting initial version in Apple AppStore to be downloaded.

You can also find my RM site, which is curated with all my social feeds here.

                                               

I have been working on Wizzle app development for over two years part time teamed up with a talented J2EE architect Robert Rudics from Switzerland with his team. It was all about bringing up a great set of features for people to interact with friends and other users of Wizzle nearby. Wizzle enables users to instantly chat, call, connect (message, image, video) with people nearby without needing even a sign-up. All you need is to launch the app and see people nearby. And you could fill up your profile later may be to explore more and more friends with Wizzle network. With this nice app you could message, send your location, send images, send instantly recorded videos and call them for completely free without any advertising. Travel mode is a cool feature with Wizzle where you search for friends in a all new way of changing your location on a map. And it’s really cool that it featured in freestyle.ch 2012 event with Big sponsors like Redbul and Zurich.

avail_on_app_store

Wizzle

  

App screen shots

    

Posted by: Tharindu | September 3, 2012

Elephanti iPhone app for Smarter Shopping

Elephanti iPhone App has been a great effort of a small team of developers, designers [more importantly close friends] located in Colombo, Sri Lanka. Mr. Lalin Michael Jinasena [Founder, CEO of Elephanti] has come up with this revolutionized idea and worked with the team in making people shop smarter with Elephanti. It has been an entertaining and exciting one and half years of developing this fantastic app. And finally with more exciting features yet to come, Elephanti App is now available for users on Apple AppStore. I feel really lucky to work as an iPhone developer on such a great app like Elephanti [Initially code named Lalinks] with our team. As the name implies Elephant[i] it’s really really big when it comes to features it offers to users and super [i]Interesting.

Elephanti App with its web site connects people to shops, people, offers in a smarter way on the go, because of that it creates a great retail media network among its users and merchants. For example, Elephanti is Smart enough to let you know that you are moving closer by an Offer that matches your Interests. With Elephanti app in your iPhone, you would be thrilled to shop in Elephanti registered Stores with Check-In discounts. Just a few to get you interested about the app.

avail_on_app_store

Elephanti App ON ABC7 News ( Featured in 30th November, 2012 )

ELEPHANTI APP SCREEN SHOTS

User Profile | Elephanti App | Store Profile

              

Nearby Offers | Elephanti App | Store Catalog

              

ELEPHANTI APP WALKTHROUGH

We formed a little team of four friends LiteDreamz.com to make some fun time creative apps. සන්හිඳ (Sanhinda) is the first one for us to start with. In our team I am working on iOS development. And my friend Dulan works on Android. Julian with his experience does graphic design for us. Asanka, we usually call him Lokkaiya works on Web, PHP developments. All of us together makes a nice combination to bring our little crazy ideas into public. I had an idea of making Sinhala transliteration app from past looking at Google Tranliterate & UCSC online transliterate tool and I have been using them for quite a while. iPhone had a lack of Sinhala Keyboard and also a transliterate app that makes Sinhala typing difficult on my favorite mobile phone. Therefore, We decided to make this idea live as the first step on Both iOS & Android. Sanhinda for Android was developed by Dulan and I developed the Sanhinda for iPhone.

Download Sanhinda for iPhone by Me

Download Sanhinda for Android by Dulan

avail_on_app_store

Sanhinda (සන්හිඳ) featured in iTunes Sri Lanka within 3 days of its initial release. Below is a few screenshots of it having top ranks in AppStore Sri Lanka.

#1 Free iPhone App in Sri Lanka

#1 Free iPhone App in Utilities Sri Lanka

 

Following is a little screen demo of සන්හිඳ for iPhone..

Few screens of the සන්හිඳ for iPhone..

        

Few screens of සන්හිඳ for Android..

         

 

Posted by: Tharindu | December 15, 2011

AES128 Encryption in iOS and Decryption in PHP

It was somewhat not straight forward getting this task done initially for me, but finally everything was fine with Objective-C & PHP on decrypting the text encrypted via iOS code with the help of Google & StackOverflow. So I thought of sharing successful piece of codes for iOS and PHP for this task on my blog. The problem with PHP is PHP does not support PKCS7Padding by default which is supported by iOS. So we need to unpad the encrypted text to make decryption successful at PHP code.

On Objective-C, we will extend NSData class and NSString class to have an AES128 encrypted string on iOS using categories. Basically, important AES128 Encryption code is listed below. But for easy reference, download NSData,NSString AES128 Categories from here. and add them to XCode project.

iOS Code

- (NSData *)AES128EncryptWithKey:(NSString *)key
{
// ‘key’ should be 16 bytes for AES128
char keyPtr[kCCKeySizeAES128 + 1]; // room for terminator (unused)
bzero( keyPtr, sizeof( keyPtr ) ); // fill with zeroes (for padding)

// fetch key data
[key getCString:keyPtr maxLength:sizeof( keyPtr ) encoding:NSUTF8StringEncoding];

NSUInteger dataLength = [self length];

//See the doc: For block ciphers, the output size will always be less than or
//equal to the input size plus the size of one block.
//That’s why we need to add the size of one block here
size_t bufferSize = dataLength + kCCBlockSizeAES128;
void *buffer = malloc( bufferSize );

size_t numBytesEncrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt( kCCEncrypt, kCCAlgorithmAES128, kCCOptionECBMode | kCCOptionPKCS7Padding,
keyPtr, kCCKeySizeAES128,
NULL /* initialization vector (optional) */,
[self bytes], dataLength, /* input */
buffer, bufferSize, /* output */
&numBytesEncrypted );
if( cryptStatus == kCCSuccess )
{
//the returned NSData takes ownership of the buffer and will free it on deallocation
return [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted];
}

free( buffer ); //free the buffer
return nil;
}

Now add the below PHP function at your server side to decrypt the text with PHP. :)

PHP Code

function decrypt_password($pass,$key)
{

$base64encoded_ciphertext = $pass;

$res_non = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($base64encoded_ciphertext), ‘ecb’);

$decrypted = $res_non;
$dec_s2 = strlen($decrypted);

$padding = ord($decrypted[$dec_s2-1]);
$decrypted = substr($decrypted, 0, -$padding);

return  $decrypted;
}

Today, I wanted to change Company Name entry in new XCode 4.2 project file templates. If it’s not set for the project by default Organization Name appears as __MyCompanyName__.

Earlier it used to be read from either ~/Library/Preferences/com.apple.Xcode.plist file Or using Address Book entry for company under current user logged in. So I was wondering why it doesn’t appear on new files I add to the project with XCode 4.2.

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions
-dict ORGANIZATIONNAME "CyberLMJ"

 

I had already added the ORGANIZATIONNAME key, but still had the default name in. Alternatively, I could have also changed the file templates in /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates or /Developer/Library/Xcode/Templates/File Templates. But it seem to be not really easy or useful, as I just needed to change company name entry only.

Finally, I found out there’s a very easy way hidden or unseen for me for some reason with new XCode, added :) Select the project and look for the right pane. View > Utilities > Show File Inspector [option + command + 1]. Organization entry is there available for each new project.

Posted by: Tharindu | April 5, 2011

Bloodless Medicine iPhone App (iAvoidBlood)

I started with few little iPhone apps at Silk. Blood App (simply termed) was one of iOS apps that I worked on during my stay at Silk. It’s later decided to name as iAvoidBlood to highlight its core function. This application is a collaborative educational project which promotes Bloodless Medicine. Bloodless Medicine refers to emerging clinical strategies for medical care without allogeneic blood transfusion and is said to be a well-defined area in Blood Management. The circular of information distributed with Blood and Blood Components recommends that all physicians be familiar with the alternatives that are a part of Bloodless Medicine.


Download iAvoidBlood on Apple Store

Blood App include three utilities named Evaluation (Animated Blood Calculator), eBlood Card & Blood Centers (Geo-Localization). In addition, App include detailed informative sections describing Blood (components of blood), Blood Transfusion, Transfusion Alternatives, Ethics and Glossary.

Evaluation utility – adds an animated calculation showing Final HT value calculated using patient or user’s Gender, Estimated Blood loss, Initial HT & Transfusion Threshold.

E-Blood Card – provides users to keep his preferences for accepting whole blood or its components. Users can share their e-blood card via emails.

Blood Centers – shows the nearest Blood Centers marked on a Google Map using iPhone Map Kit framework. Using Google Geo-coding API users are provided a way to search for nearest blood centers from any location. Data for the blood centers are read from silk web services. Even user could look for the route for Blood center and its details.

Transfusion Alternatives – provides comprehensive detailed section that describe the top to bottom details on Bloodless Medicine.

avail_on_app_store

Following is a quick video of the Blood App.

Following are some screen shots for the app.

I was needed to somehow add VoIP into my Level4 Project. It made me search all over Google for some existing work. And found this project Siphon that enables SIP voice calls. There are few guides on Siphon Wiki, still I was stuck with linking issues for nearly a month. After trying lots of hours I gave up all that trying to compile for iPhone 3.0. Again yesterday, I have been trying to compile free open source project Siphon to run on iPhone Simulator and iPhone all day. It was really difficult task having the Siphon team done lots of effort on making an Open Source project, still just to compile it. My lack of knowledge in C++ or C made this even harder. Finally lots of hours invested, days wasted now I have it running on my iPhone. So may be this will help some newbie on low level coding (C, C++) other than Objective-C to run this amazing app compiled on your iPod or iPhone. Having credits on your SIP account you may convert your iPod into an iPhone on WiFi.

Siphon Project on Google Code

Siphon has wiki pages saying how it could compile to iPhone OS 2.x but still it seems to be not enough and I couldn’t make it success by any means unfortunately.

Steps to follow for Newbie.

1. We need to compile and build required libraries from compiling PJSIP project first. There are few things I did wrong here. I have compiled for Device and tried to run it on Simulator without writing my own configure script. Trying to use same one on PJSIP Then I got so many linking issues that I couldn’t understand WTF is this.

2. Let’s compile PJSIP for iPhone first and build libraries required and then to Simulator as well with a more change to configure script. Before going into Siphon project.

2-1. Download PJSIP source code from here. Now it includes configure script for iPhone that you need to edit once for iPhone again for Simulator.

svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject

2-2. Create a new file pjlib/include/pj/config_site.h.  Add following code into it.

#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>

2-3. If you go to pjproject folder, you will see configure-iphone script. Need to edit this to compile for your desired iPhone SDK. Open this with your favorite Text editor, mine was TextWrangler.

$ edit configure-iphone

2-4. Hard code the $DEVPATH and $IPHONESDK. So you don’t need to export those environment variables. If you not specify $IPHONESDK it will be the OS default. ex.

DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer
IPHONESDK=iPhoneOS3.0.sdk

2-5. Now you can easily build the libraries that will be stored in lib directories of folders, pjlib, pjlib-util, pjmedia, pjnath, pjsip, third_party. Check once again about your configure-iphone script for correct paths and compile and build libraries using following commands simply.

$ cd /path/to/your/pjproject/dir
$ ./configure-iphone
$ make dep && make clean && make

2-6. Now you have libraries for iPhone. Make a copy of pjproject folder and rename it to pjproject_sim. Here we are going to have our iPhone Simulator libraries built

$ cd /path/to/your/pjproject_sim/dir
$ edit configure-iphone

2-7. Hard code the $DEVPATH and $IPHONESDK. This time they should the paths for Simulator SDKs. And one more change here, that I was missing. caused all sorts of problems.

2-8. Search for 'ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*' in configure script and replace it with following that way you could build correct libraries for simulator.

ls -d ${SDKPATH}/usr/lib/gcc/i686-apple-darwin*

2-9. Great now you have all libraries needed in folders, pjproject and pjproject_sim.

3. Now let’s go and checkout siphon project.

svn checkout http://siphon.googlecode.com/svn/trunk/ siphon

4. There was a compilation issue in Siphon code, that you could ignore by doing a little trick, I don’t know whether its right or wrong. But it works perfect. Otherwise, project didn’t compile for me. Open Siphon2 folder iPhone project on iPhone then go to call.m. Search for PJSIP_CRED_DATA_MJ_DIGEST and replace it with PJSIP_CRED_DATA_DIGEST.

5. Now add all the library .a files in following folders to the project. pjlib, pjlib-util, pjmedia, pjnath, pjsip, third_party.

6. Now follow the screen shots carefully. If you build for simulator use simulator library files (pjproject_sim folder) and include files to library and header search paths, other wise use libraries & include files in pjproject folder.

Make a duplicate of Debug to run in iPhone, let debug to be used by used by simulator libraries.

Let’s add Library Search Paths & Header Search Paths for siphon target. Following are examples of my locations for simulator. For device its the location to pjproject folder we built and stored our library files for Device.

Change CYDIA=0 in Preprocessor Macros

7. Add the Settings Bundle for your project as given in this following link. It works perfect then.

Siphon and Settings Bundles

8. Now you could run it on your iPhone or Simulator. Use a free SIP service to create SIP accounts to test the app. I have used, Sip2Sip

NOTES ABOUT COMPILING “PJSIP”

Following link contains very useful information updated about how to get PJSIP compiled for iOS. Please refer to the pjproject Wiki page below.

Building for Apple iPhone, iPad and iPod Touch

* IMPORTANT: I had to follow additional step to get things done for iOS Simulator. before run ./configure-iphone script

export DEVPATH=/Developer/Platforms/iPhoneSimulator.platform/Developer
export CC=$DEVPATH/usr/bin/gcc
export CFLAGS="-O2 -m32 -miphoneos-version-min=3.0" LDFLAGS="-O2 -m32"

Older Posts »

Categories

Follow

Get every new post delivered to your Inbox.