Saturday, March 16, 2013

Gmail Tip: Mark All Unread Mail as Read

I Have thousand of unread mails. it is time consuming to make all mails to read.
1.Go to your Settings/Filters page and create a new filter.
2. In the Has the words field enter “is:unread” (without quotes), and click the Next Step button
3.You’ll get a message warning you that this type of filter won’t be applied to new mail, but that’s OK. Click OK to continue.
4.Check the boxes next to Mark as read and Also apply filter to … conversations below.
5.Click Create Filter button, and you’re done. You might want to should delete the filter once you finish since it won’t be needing it anymore.

PhoneGap Android XhrFileReader

This post is copy from the simon macdonst blog this help me a lot in my one of the app.

The FileReader API works great as long as the file you want to read is on the device's file system. However if you want to read a file you've packed in the Android assets folder you would need to use XHR to read the file. I'm providing an interface that follows the same API as the regular FileReader. Of course the XhrFileReader is not limited to only reading files from the assets folder, it can also read files from the file system and over HTTP.

Adding the plugin to your project 

To install the plugin, move XhrFileReader.js to your project's www folder and include a reference to it in your html files.

Using the plugin 

To instantiate a new reader use the folling code:

var reader = cordova.require("cordova/plugin/xhrfilereader"); 
Setup your event handlers:

// called once the reader begins
reader.onloadstart = function() {
    console.log("load start");
};
// called when the file has been completely read
reader.onloadend = function(evt) {
    console.log("File read");
    console.log(evt.target.result);
}; 
Unfortunately, you will only get an error on files read over HTTP. When you specify a file:// path the request status is always 0. There is no way to tell between a successful read or an error. So if you specify a file that does not exist like "file:///does.not.exist.txt" you will get an empty evt.target.result in your onloadend handler.

// called if the reader encounters an error
reader.onerror = function(error) {
    console.log("Error: " + error.code);
}; 
Progress events are fired but are not very useful as they don't contain partial results.

// called while the file is being read
reader.onprogress = function(evt) {
    console.log("progress");
}; 
Finally call your read method, for instance:

reader.readAsText("http://www.google.com"); reader.readAsText("file:///android_asset/www/config.json"); reader.readAsText("file:///sdcard/error.log");
and that's about it. Obviously, this plugin is most useful when you need to read a text file from the assets folder.

Github: https://github.com/macdonst/XhrFileReader

How can I add older version of iOS SDK in Xcode


I create a Iphone app is working fine in the iOS 5.1 sdk but now in iOS 6.1 sdk.  Then i update my Xcode to 4.6.1 now what happen i sort out  the app issue but when i am trying to submit the app was trying to build the ipa file it gave an error
Apple Mach-o linker error
 linker command failed with exit code 1 (use -v to see invocation)
Here is my solution note.
  1. Download xcode_4.4.1_6938145.dmg in https://developer.apple.com/downloads/
  2. Load up the dmg file then go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ you will find iPhoneOS5.1.sdk (this is what i want in this case).
  3. Copy iPhoneOS5.1.sdk folder into your Xcode folder /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  4. Restart Xcode
  5. Open Xcode project setting->build settings->base SDK, then you will see iOS 5.1 option.
You need to copy the iPhoneOS5.1.sdk to the directory
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
and iPhoneSimulator5.1.sdk to


/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
Now restart your Xcode change the iOS to 6.1 to 5.1 THen it will compile the app into your iPhone. if it is helpful then post a comment below.