Sunday, March 20, 2016

AGENT MELA - One Stop Solution

Find Agents Around You or Earn Money as Agent Download App Now

Agent Mela







https://play.google.com/store/apps/details?id=com.agentmela.com

Sunday, December 27, 2015

Amazing  Dry Chicken Masala

Monday, February 3, 2014

APP Manager for Android to manage your bandwidth and internet usage.


https://play.google.com/store/apps/details?id=com.innokria.AppManager&hl=en

Thursday, January 17, 2013

javascript to android injection


step 1 ) register you class with an interface , open eclipse project and write

Launchs _accessors = new Launchs();

 web.addJavascriptInterface(new Launchs(), "test_callback");

this will register interface


now define your class

class Launchs{
              
            public void nativeLaunch(String url){
               
               
               
                Log.d("aaa",url);
            }
               
            }



#############

now to call native method from javascript   just use this code in html file.( this html is loaded in webview)

html code

window.test_callback.nativeLaunch("paramater"); / this will call native method  in android....

Cheers :)


Javascript to Obj-c Injection (iphone)

To control in UIwebview  via javascript  Injection

Here we are overriding window.open method so that we can launch  this on separate browser rather than opening in webview .

- (void)webViewDidFinishLoad:(UIWebView *)myWebView {
    [self.webView stringByEvaluatingJavaScriptFromString:@"var script = document.createElement('script');"
     "script.type = 'text/javascript';"
    
     "script.text = \"var open_=window.open ;window.open=function (url ,name)  { var prefix='ns://'; "
     "open_(prefix+url);return (prefix+url)"
     "}\";"
     "document.getElementsByTagName('head')[0].appendChild(script);"];
  
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
      
   
}




 And then handle the special case in

-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
   
   
    if ([[[inRequest URL] scheme] isEqualToString:@"ns"] == YES)
    {
        [self.webView stopLoading];
               NSLog(@"it works do what ever you want ");
      

}
} 


Wednesday, April 4, 2012

Handing NULL value in SQLITE




                Replace   NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
               


with



 NSString *aName = [NSString stringWithFormat:@"%s",(char *)sqlite3_column_text(compiledStatement, 0)];
               

Monday, April 2, 2012

Unique Time Interval

NSString *k= [NSString stringWithFormat: @"%.0f", [NSDate timeIntervalSinceReferenceDate] * 1000.0];

 NSLog(@"k is  -----%@",k);

Wednesday, March 21, 2012

atmoc non atmoic

 i found on someblog nice explanation :)


The best was to understand the difference is using following example. Suppose there is an atomic string property called "name", and if you call [self setName:@"A"] from thread A, call [self setName:@"B"] from thread B, and call [self name] from thread C, then all operation on different thread will be performed serially which means if one thread is executing setter or getter, then other threads will wait. This makes property "name" read/write safe but if another thread D calls [name release] simultaneously then this operation might produce a crash because there is no setter/getter call involved here. Which means an object is read/write safe (ATOMIC) but not thread safe as another threads can simultaneously send any type of messages to the object. Developer should ensure thread safety for such objects.
If the property "name" was nonatomic, then all threads in above example - A,B, C and D will execute simultaneously producing any unpredictable result. In case of atomic, Either one of A, B or C will execute first but D can still execute in parallel.

FEEDJIT Live