11:00 AM, Posted by ruchira, 2 Comments
Crittercism is very useful in many of our developments.
If you have tried to make a new app with Crittercism, they ask you a question "Is this an employee facing app". Apparently, there seems to be no definition and I couldn't figure it out even with the help of my teammates. So, I asked Crittercism myself and here is their explanation.
"The question is asked to find out whether your application will be published in the App Stores for anyone to download (B2C) or whether they will be used internally within your organization or company by employees only (B2E)."
Hope this helps you too :)
2:58 AM, Posted by ruchira, No Comment
This is going to be my very first post on Android development.
You may know that I've written many posts on Dot Net, Java & iPhone. From today onwards, I will add Android to that list :)
So, if you're in a situation that you need to have a single label(TextView) with multiple formats, then this will be the post for you. It becomes very simple when you know a bit of html.
Here is a list of tags supported by Android TextView before you get started.
Have a look at this before you start.
Suppose you have a TextView named multiFormatView
The first step is to build your HTML string.
String htmlString = "<b>This is bold</b>"+"And this is not.";
Now there is only one line of code. Just set the text to the TextView using.
Happy coding my friends
1:59 AM, Posted by ruchira, No Comment
Sometimes you may encounter situations where you have a file which is used frequently throughout the XCode project. This may be a configurations file which is used in 80% of your code files. Importing this in each file is a certain possibility(and the very normal way with no issues), but if you are lazy and just want to add it in one place, this is the post for you.
If you analyze the project, there is a file named <project-name>.pch. There is a block of code which has the following.
NOTE: As you can see, UIKit is already added and so is the Foundation framework. That is why you can use classes such as "UIView" or "NSArray" without any additional imports in your code file. That's just an extra bit of info for the curious !!!.
So, likewise, we can add our commonly used file into that block as well in the following manner.
Once you add this, you can use "MyConfigFile" within your project without additionally importing it in each file.
NOTE: Remember, this is not the place to import each and every file for convenience. Only do it if the file is needed to be imported across a wide number of places in the project. Otherwise it'll just bring more trouble.
Happy coding :)
1:27 AM, Posted by ruchira, No Comment
In building iPhone applications you may have come across situations that you count some time in seconds, but wish to let the user view it in a more readable format such as 1 hour 38 minutes and 44 seconds. Here is a piece of code that I wrote if you need to get this done in your code.
3:57 AM, Posted by ruchira, No Comment
10:54 PM, Posted by ruchira, No Comment
You must have faced situations where you need to convert a date string to a different object.
The usual procedure is to first parse the string into a Date object of that language, specifying your formatting string.
The next step is to convert the Date object back into a string specifying the new formatter.
Moment.js which is freely distributable under the MIT license. You can download it from here.
There are two versions. You can download the minified source if you need to save space.
The following example shows how to use it to convert from one format to another.
var oldFormatTime = moment('2012-10-01','YYYY-MM-dd');
var newFormatTime = oldFormatTime.parse('d-MM-YYYY');
So, the final output would be 1-10-2012
In addition to this, I also found the following library.
Datejs is an open source nice library hosted at Google code for you to use.
You can download it from here.
The following example illustrates how to do this.
Eg: Suppose you have the date as '2012-12-12' and you need to convert it to 'December 12, 2012'.