Posts

Showing posts from 2015

Could not find Developer Disk Image Xcode 7.1

I got an issue "Could not find Developer Disk Image Xcode 7.1" after updating to iOS 9.2.

_handleNonLaunchSpecificActions:forScene:withTransitionContext:

** -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action -> <FBSSceneSnapshotAction: 0x15fb3d290> {     handler = remote;     info = <BSSettings: 0x15f9fbe50> {         (1) = 5;     };
}



This info is for iOS during screenshot, you can safely ignore.

Cordova iOS - NSAutoresizingMaskLayoutConstraints should not be in there.

Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want.  Try this:  (1) look at each constraint and try to figure out which you don't expect;  (2) find the code that added the unwanted constraint or constraints and fix it.  (     "<NSLayoutConstraint:0x1265957d0 V:|-(20)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>",     "<NSLayoutConstraint:0x1265a81e0 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>" )
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1265957d0 V:|-(20)-[UIInputSetContainerView:0x126570180]   (Names: '|':UITextEffectsWindow:0x126530b20 )>

Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating

[initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating

Got this issue in mac


Mongoldb instance is running in the system.


Stop the server
$mongo admin --eval "db.shutdownServer()"









_handleNonLaunchSpecificActions error in IOS9

I got an issue in iOS 9 when i lock and unlock the phone.  


** -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action -> <FBSSceneSnapshotAction: 0x160aa36f0> {     handler = remote;     info = <BSSettings: 0x160aa3830> {         (1) = 5;     };
}


Any help on this for resolution?  Thanks in advance

ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

Cordova ionic issue ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

Plugin 'Keyboard' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

Cordova ionic issue 
Plugin 'Keyboard' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

Upgraded iPhone version from iOS 8 to iOS 9, got this issue in iOS 9

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.





NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:04.058 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:04.323 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:04.646 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:04.978 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:05.390 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:05.724 [585:147628] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)2015-09-18 13:27:06.086 [585:147628] NSURLSession/NSURLConn…

Message from debugger: failed to send the k packet

Message from debugger: failed to send the k packet

TypeError: Cannot read property 'DEFAULT_PORT' of undefined

TypeError: Cannot read property 'DEFAULT_PORT' of undefined
This issue is due to running with Default port instead of '27017'.
Change from 
module.exports = new Db(settings.db, new Server(settings.host, Connection.DEFAULT_PORT), {safe: true});

To

module.exports = new Db(settings.db, new Server(settings.host, '27017'), {safe: true});


js-bson: Failed to load c++ bson extension, using pure JS version

Nodejs , mongoldb issue while running the server


js-bson: Failed to load c++ bson extension, using pure JS version

I resolved by updating the npm

>npm update   from the terminal

Running Library project in Android studio

In build.grandle changeapplyplugin: 'com.android.library'toapplyplugin: 'com.android.application'Create an activity to call the library apiDeclare the activity in manifest file.Declare all other required permissions in manifest

Android studio - NDK is not configured

I got an issue in studio while building ndk project.

I have solved by giving ndk path in local.properties.

sdk.dir=/Users/srin/Library/Android/sdkndk.dir=/Users/srin/Documents/Srin/android-ndk-r10dEnvironment : Mac OSX

Bitmap to ByteArray Android

publicstaticbyte[] convertBitmapToByteArray(Bitmap bitmap) { if (bitmap == null) { returnnull; } else { byte[] b = null; try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, byteArrayOutputStream); b = byteArrayOutputStream.toByteArray(); } catch (Exception e) { e.printStackTrace(); } return b; }
}

ARC forbids explicit message send of 'release'

ARC forbids explicit message send of 'release'

ARC is an automatic reference counting. Here no need to release memory manually, ARC will release automatically.

Its a compiler feature that , it uses automatic memory management of objective c objects.

Error in manifest android:debuggable="true"

Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign   one

I added this for android manifest, 
android:debuggable="true"

I got solved by cleaning the project. Now i am able to debug.

Image Processing

What is an image ?

Image is collection of pixels.

Types of images:

1. Grey scale image
2. Binary Image
3. Coloured Image


Image Processing is image and processing.

 Applying the image modification techniques like converting into grey scale image, detecting the pixel density etc..


OpenCv tutorial

Open Source Computer Vision (OpenCV)  -  Four Modules are there.

CV - Main OpenCV functions, image processing and vision algorithms.

CVAUX  - Experimental OpenCv functions.

CXCORE -Data structure support and other algorithms.

HIGHGUI : Graphical User Interface functions , image and video.












Fatal signal 11 (SIGSEGV) at 0x3b0dcef0 (code=1)

Fatal signal 11 (SIGSEGV) at 0x3b0dcef0 (code=1), thread 973
 Send stop signal to pid:973 in void debuggerd_signal_handler(int, siginfo_t*, void*)

!!! FAILED BINDER TRANSACTION !!!

!!! FAILED BINDER TRANSACTION !!!


I got this issue while transferring large bitmap data.

intent.putExtra("imagedata", data);
To resolve this issue, avoid transferring of large bitmaps.
The binder transaction failed due to large size.During remote procedure call, arguments and the returned value of call transferred as Parcel objects stored under the binder transaction buffer. If the returned value or arguments too large to fit in the transaction butter, the call will get fail and TransactionTooLargeException will be thrown.




java.lang.UnsatisfiedLinkError Android NDK

04-10 14:49:35.505: E/AndroidRuntime(14206): java.lang.UnsatisfiedLinkError: Native method not found: com.permadi.testjni.TestJNIActivity.stringFromJNICPP:()Ljava/lang/String;
04-10 14:49:35.505: E/AndroidRuntime(14206): at com.permadi.testjni.TestJNIActivity.stringFromJNICPP(Native Method)
04-10 14:49:35.505: E/AndroidRuntime(14206): at com.permadi.testjni.TestJNIActivity.onCreate(TestJNIActivity.java:18)
04-10 14:49:35.505: E/AndroidRuntime(14206): at android.app.Activity.performCreate(Activity.java:5275)
04-10 14:49:35.505: E/AndroidRuntime(14206): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)




Solution: please check the package name and method name for an activity. I got this issue due to case sensitive in cpp file for package name or method name.

Android NDK Hello World

TestJNIActivity.java

package com.permadi.testjni;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

public class TestJNIActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_jni);


TextView myTextField = (TextView)findViewById(R.id.myTextField);
       myTextField.setText(stringFromJNICPP());
}


public native String  stringFromJNICPP();

static {
        System.loadLibrary("TestJNI");
    }

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.test_jni, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
/…

Custom ImageView Circular imageview

Circular imageview android


import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuff.Mode; import android.graphics.PorterDuffXfermode;
import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; importandroid.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView;
publicclass RoundImageView extends ImageView {
public RoundImageView(Context context) { super(context); }
public RoundImageView(Context context, AttributeSet attrs) { super(context, attrs); }
public RoundImageView(Context context, AttributeSet attrs, intdefStyle) { super(context, attrs, defStyle); }
@Override protectedvoid onDraw(Canvas canvas) { BitmapDrawable drawable = (BitmapDrawable) getDrawable();
if (drawable == null) { return; }
if (getWidth() == 0 || ge…

Admob integration into Android application (Google advertisements )

In Activity file add the below code
AdView mAdView = (AdView) rootView.findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); mAdView.loadAd(adRequest);

Declare in your xml layout file wherever you want to place advertisement
     <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="match_parent" android:layout_height="100dp" android:layout_weight="1" ads:adSize="BANNER" ads:adUnitId="@string/banner_ad_unit_id" >
</com.google.android.gms.ads.AdView>

Manifest declaration :

<!--Include the AdActivity configChanges and theme. --> <activityandroid:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent"/>


in strings.xml declare banner ad unit id <stringname="banner_ad_unit_id"&g…