Learn Android for Free,issues for developers, mobengineers website provide complete solutions for developers issues posts.It also provides online training for android development

Wednesday, December 23, 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.

Thursday, December 3, 2015

_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.

Tuesday, November 17, 2015

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 )>

Saturday, October 10, 2015

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()"










Sunday, September 27, 2015

_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

Saturday, September 26, 2015

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.


Thursday, September 17, 2015

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/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

Disabling the iOS 9 transport security.

Fixed by adding these to info.plist


 <key>NSAppTransportSecurity</key>    <dict>
        <key>NSAllowsArbitraryLoads</key>        <true/>
    </dict>



Tuesday, September 8, 2015

Message from debugger: failed to send the k packet

Message from debugger: failed to send the k packet

Monday, September 7, 2015

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

Monday, June 29, 2015

Running Library project in Android studio

In build.grandle 
change
apply plugin: 'com.android.library'to
apply plugin: 'com.android.application'
Create an activity to call the library api
Declare the activity in manifest file.
Declare all other required permissions in manifest

Sunday, June 14, 2015

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/sdk
ndk.dir=/Users/srin/Documents/Srin/android-ndk-r10d


Environment : Mac OSX

Thursday, April 23, 2015

Bitmap to ByteArray Android

public static byte[] convertBitmapToByteArray(Bitmap bitmap) {
if (bitmap == null) {
return null;
} 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;
}

}

Wednesday, April 22, 2015

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.

Sunday, April 19, 2015

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.

Thursday, April 16, 2015

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.












Wednesday, April 15, 2015

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.





Friday, April 10, 2015

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
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}




TestJNI.cpp

#include <string.h>
#include <jni.h>
#include <android/log.h>

 extern "C" {
     JNIEXPORT jstring JNICALL Java_com_permadi_testjni_TestJNIActivity_stringFromJNICPP(JNIEnv * env, jobject obj);
 };

 JNIEXPORT jstring JNICALL Java_com_permadi_testjni_TestJNIActivity_stringFromJNICPP(JNIEnv * env, jobject obj)
 {
return env->NewStringUTF("Hello World");
 }

Tuesday, March 3, 2015

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;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;

public class RoundImageView extends ImageView {

public RoundImageView(Context context) {
super(context);
}

public RoundImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}

public RoundImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

@Override
protected void onDraw(Canvas canvas) {
BitmapDrawable drawable = (BitmapDrawable) getDrawable();

if (drawable == null) {
return;
}

if (getWidth() == 0 || getHeight() == 0) {
return;
}

Bitmap fullSizeBitmap = drawable.getBitmap();

int scaledWidth = getMeasuredWidth();
int scaledHeight = getMeasuredHeight();

Bitmap mScaledBitmap;
if (scaledWidth == fullSizeBitmap.getWidth()
&& scaledHeight == fullSizeBitmap.getHeight()) {
mScaledBitmap = fullSizeBitmap;
} else {
mScaledBitmap = Bitmap.createScaledBitmap(fullSizeBitmap,
scaledWidth, scaledHeight, true /* filter */);
}


Bitmap circleBitmap = getCircledBitmap(mScaledBitmap);

canvas.drawBitmap(circleBitmap, 0, 0, null);

}

public Bitmap getRoundedCornerBitmap(Context context, Bitmap input,
int pixels, int w, int h, boolean squareTL, boolean squareTR,
boolean squareBL, boolean squareBR) {

Bitmap output = Bitmap.createBitmap(w, h, Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final float densityMultiplier = context.getResources()
.getDisplayMetrics().density;

final int color = 0xff424242;

final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, w, h);
final RectF rectF = new RectF(rect);

// make sure that our rounded corner is scaled appropriately
final float roundPx = pixels * densityMultiplier;

paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);

// draw rectangles over the corners we want to be square
if (squareTL) {
canvas.drawRect(0, 0, w / 2, h / 2, paint);
}
if (squareTR) {
canvas.drawRect(w / 2, 0, w, h / 2, paint);
}
if (squareBL) {
canvas.drawRect(0, h / 2, w / 2, h, paint);
}
if (squareBR) {
canvas.drawRect(w / 2, h / 2, w, h, paint);
}

paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(input, 0, 0, paint);

return output;
}

Bitmap getCircledBitmap(Bitmap bitmap) {

Bitmap result = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(result);

int color = Color.BLUE;
Paint paint = new Paint();
Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());

paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,
bitmap.getHeight() / 2, paint);

paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);

return result;
}


}

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. -->
        <activity android: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
<string name="banner_ad_unit_id">ca-app-pub-8076328522522776/3847247228</string>


Now ready to see ads in the application.

20% off

Online Training

Your Name :
Your Email: (required)
Your Message: (required)

NDTV Gadgets360

Blog Archive

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts