We provide complete mobile and web apps development solutions

Tuesday, July 23, 2013

java.lang.OutOfMemoryError: thread creation failed

07-24 00:26:16.176: E/AndroidRuntime(2621): java.lang.OutOfMemoryError: thread creation failed
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.VMThread.create(Native Method)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.Thread.start(Thread.java:1050)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.<init>(ThreadSafeClientConnManager.java:98)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.loopj.android.http.AsyncHttpClient.<init>(AsyncHttpClient.java:133)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at  com.rest.RestClient.<init>(RestClient.java:11)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com..rest.PapayaRestClient.<init>(PapayaRestClient.java:18)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.rest.PapayaRestInterface.<init>(PapayaRestInterface.java:23)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.pensio.papaya.activities.TestFragmen.onCreateView(TestFragmen.java:55)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.os.Handler.handleCallback(Handler.java:725)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.os.Looper.loop(Looper.java:137)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at android.app.ActivityThread.main(ActivityThread.java:5039)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.reflect.Method.invokeNative(Native Method)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.reflect.Method.invoke(Method.java:511)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at dalvik.system.NativeStart.main(Native Method)

Thursday, July 18, 2013

Regular expression for Email validation in java


       public boolean validateEmail(String email) {
              if ((email != null)
                           && email.matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
                                         + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")) {
                     return true;
              }
              return false;
       }

URLEncoder.encoder(string) is depreciated



URLEncoder.encoder(string)  ,URLEncoder.decoder(string) is depreciated.
Use URLEncoder.encoder(string ,string) instead.

Tuesday, July 16, 2013

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

07-17 02:09:05.021: A/libc(18457): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 18532 (pool-1-thread-1)

Friday, July 12, 2013

Android Alert Dialog


 Awesome Dialog



import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;

public class AwesomeDialog extends Activity {
    EditText etSearch;
    Button showDialog;
    Dialog dialog;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        showDialog = (Button) findViewById(R.id.show_dialog);
        showDialog.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                dialog = new Dialog(AwesomeDialog.this,
                        android.R.style.Theme_Translucent);
                dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

                dialog.setCancelable(true);
                dialog.setContentView(R.layout.dialog);
                Button done = (Button) dialog.findViewById(R.id.done);
                done.setOnClickListener(new OnClickListener() {

                    @Override
                    public void onClick(View v) {
                        dialog.dismiss();

                    }
                });
                dialog.show();

            }
        });

    }

}
package com.mobengineers;




 <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <gradient
        android:angle="90"
      android:endColor="#848484"
        android:startColor="#B6B6B6" />

    <padding
        android:bottom="10dp"
        android:left="10dp"
        android:right="10dp"
        android:top="10dp" />

    <stroke
        android:width="2dp"
        android:color="#000000" />

    <corners android:radius="40dp" />

</shape>



dialog.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:background="@drawable/bgdialog"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="Awesome Dialog"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/etsearch"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/tv"
        android:layout_centerHorizontal="true"
        android:layout_margin="10dp" >
    </TextView>

    <Button
        android:id="@+id/done"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/etsearch"
        android:layout_centerHorizontal="true"
        android:text=" Done" />

</RelativeLayout>



 Download Source code here



https://github.com/Pensio/Android-Awesome-Dialog.git

Online Training

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

Powered by Blogger.

Recent Posts

Find Us On Facebook

Popular Posts