Thursday, July 16, 2015

AndroidCodeGeeks | The Android Knowledge Base

0 comments






Android Code Geeks is knowledge base which maintain categorize android tutorials which will help android developers to find the best articles,videos and examples.

Website : AndroidCodeGeeks.com
Twitter : @AndroidCodeGeek
FB : AndroidCodeGeeks on Facebook
Read more...

Thursday, January 29, 2015

Android-Libs.com for Android Developers

0 comments
Android developers gain a lot of advantages from working on a platform with a wide variety of libraries, open source projects, and other resources to help get their work to the finish line. Unfortunately, if a problem can’t be solved by checking out the SDK samples or reading a few dozen StackOverflow questions, it can be pretty hard to find good alternatives when they are most needed. Before giving up on the tricky problems, or possibly before attempting them, check out Android-Libs.com – a registry of open source code, libraries, handy websites, utilities, and other tools that may be useful to Android developers of all types.
Most entries link back to Github project pages with embedded counters for the number of open issues, forks, watchers, and stars. Beyond these statistics, most resources also include a short description, minimum API level (if relevant), a screenshot, a Gradle compile line to include libraries, and a few other details. Finally, everything has been sorted into a pretty lengthy list of categories for easy browsing, and there is a search box that queries project titles and descriptions.
If you’re looking for a library or shortcut to get a certain feature working right out of the gate, or trying to find a good solution after spending hours running into a wall, take a look at Android-Libs. It’s always great to see another helpful resource for the Android development community. The site is even open source on Github, in case there is something useful to learn from checking out the code.
The registry is updated regularly, but most of the activity is also published to an RSS feed and a custom PushBullet channel, so it's easy to see when new additions make it to the list. It's definitely worth checking out Android-Libs.com and bookmarking it for the future.
Read more...

Saturday, March 8, 2014

Android Libs Org

0 comments
Android Libs | Android Libs is a place to gather all open source Android UI Views, Android Libraries, Android Tools and Plugins

Android Libs Org



Android Libs Org | Android Libs Org is a place to gather all open source Android UI Views, Android Libraries, Android Tools and Plugins


Android Libs Org will help you to find the  UI Views, Libraries, Tools and Plugins.

If you found a good Android Library do not forget to contact  Android Libs Org and let them know to update it.




Android Libs Org | Android Libs Org is a place to gather all open source Android UI Views, Android Libraries, Android Tools and Plugins



Contribute to AndroidLibs.Org



Read more...

Friday, January 10, 2014

Android ScrollView with GestureDetector

0 comments

The implementation of Android GestureDetector with ScrollView 



ScrollLayoutActivity


import android.os.Bundle;
import android.app.Activity;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Toast;

public class ScrollLayoutActivity extends Activity {

 private static String TAG = ScrollLayoutActivity.class.getSimpleName();

 private LinearLayout mTopLayout;
 private LinearLayout mMiddleLayout;
 private LinearLayout mBottomLayout;

 private ScrollView mScrollView;

 private boolean possitionTop;
 private boolean possitionMiddle = true;

 int mLayoutHeight;
 float mDeviceHeight;

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

  DisplayMetrics displayMetrics = new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

  // final float height=displayMetrics.heightPixels/displayMetrics.xdpi;

  // device height in pixels
  mDeviceHeight = displayMetrics.heightPixels;
  mLayoutHeight = (int) mDeviceHeight / 3;

  mScrollView = (ScrollView) findViewById(R.id.scrv);

  mTopLayout = (LinearLayout) findViewById(R.id.top);
  mMiddleLayout = (LinearLayout) findViewById(R.id.middle);
  mBottomLayout = (LinearLayout) findViewById(R.id.bottom);

  mTopLayout.setLayoutParams(new LinearLayout.LayoutParams(mTopLayout
    .getLayoutParams().width, mLayoutHeight));
  mBottomLayout.setLayoutParams(new LinearLayout.LayoutParams(
    mBottomLayout.getLayoutParams().width, mLayoutHeight));
  mMiddleLayout.setLayoutParams(new LinearLayout.LayoutParams(
    mMiddleLayout.getLayoutParams().width, (int) mDeviceHeight));

  mScrollView.setHorizontalFadingEdgeEnabled(false);
  mScrollView.setVerticalFadingEdgeEnabled(false);
  mScrollView.post(new Runnable() {
   public void run() {
    mScrollView.scrollTo(0, mLayoutHeight);
   }
  });

  // findViewById(R.id.button).setOnClickListener(new
  // View.OnClickListener() {
  //
  // @Override
  // public void onClick(View v) {
  // Toast.makeText(ScrollLayoutActivity.this, "height : " +
  // mDeviceHeight, Toast.LENGTH_SHORT).show();
  // }
  // });

  Toast.makeText(this, "Device Height : " + mDeviceHeight,
    Toast.LENGTH_SHORT).show();

 }

 public boolean dispatchTouchEvent(MotionEvent ev) {
  return mGestureDetector.onTouchEvent(ev);
 }

 SimpleOnGestureListener simpleOnGestureListener = new SimpleOnGestureListener() {
  @Override
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
    float velocityY) {
   String swipe = "";
   float sensitvity = 100;

   if ((e1.getX() - e2.getX()) > sensitvity) {
    swipe += "Swipe Left\n";
   } else if ((e2.getX() - e1.getX()) > sensitvity) {
    swipe += "Swipe Right\n";
   } else {
    swipe += "\n";
   }

   if ((e1.getY() - e2.getY()) > sensitvity) {
    swipe += "Swipe Up\n";
    if (!possitionMiddle && possitionTop) {
     mScrollView.scrollBy(0, mLayoutHeight);
     possitionTop = false;
     possitionMiddle = true;
    } else if (possitionMiddle && !possitionTop) {
     mScrollView.fullScroll(ScrollView.FOCUS_DOWN);
     possitionTop = false;
     possitionMiddle = false;
    }
   } else if ((e2.getY() - e1.getY()) > sensitvity) {
    swipe += "Swipe Down\n";
    if (possitionMiddle && !possitionTop) {
     mScrollView.fullScroll(ScrollView.FOCUS_UP);
     possitionTop = true;
     possitionMiddle = false;
    }
    if (!possitionMiddle && !possitionTop) {
     mScrollView
       .scrollTo(mScrollView.getBottom(), mLayoutHeight);
     possitionTop = false;
     possitionMiddle = true;
    }
   } else {
    swipe += "\n";
   }
   Log.d(TAG, swipe);
   return super.onFling(e1, e2, velocityX, velocityY);
  }

 };

 GestureDetector mGestureDetector = new GestureDetector(
   simpleOnGestureListener);
}




activity_scroll_layout.xml 



<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrv"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    android:scrollbars="none" >

    <LinearLayout
        android:id="@+id/container2"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:background="#1E1E1E"
        android:baselineAligned="false"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/top"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@android:color/black"
            android:baselineAligned="false"
            android:orientation="vertical" >
        </LinearLayout>

        <LinearLayout
            android:id="@+id/middle"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@android:color/white"
            android:baselineAligned="false"
            android:orientation="vertical" >

            <Button
                android:id="@+id/button"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Button" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/bottom"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:background="@android:color/darker_gray"
            android:baselineAligned="false"
            android:orientation="vertical" >
        </LinearLayout>
    </LinearLayout>

</ScrollView>

Read more...

Tuesday, December 10, 2013

Sith Browser

2 comments

Sinhala Android web Browser | Tamil Android web Browser 

Sinhala Android web browser

Sith Browser is light weight fast Android web Browser (Sinhala Android web browser / Tamil Android web Browser). Happy Browsing
★ Sinhala web Browser
★ Tamil web Browser
Features:
- Unlimited Tabs
- Full Screen Mode
- Incognito Browsing (Incognito Mode keeps you safe while browsing,History is not saved, Cookies are disabled, and Location access is disabled to ensure as best we can that you are not being tracked )
- Bookmarks
- History
- Block Images
- Flash Support
- Fast Sinhala and Tamil Rendering
- Search Engine
- FREE No Ads
Download Sith Browser and enjoy a faster experience with Sinhala Tamil web browsing.

Tamil Android web Browser



Read more...

Friday, September 6, 2013

Android Swipe List View

1 comments


SwipeListView 

An Android List View implementation with support for drawable cells and many other swipe related features. on Android for @ 47 Degrees





Fork source code from githon Android for @ 47 Degreesub
Read more...

Thursday, June 27, 2013

Android AnimationDrawable - Loading Example

0 comments

Android Drawable Animation 


In this tutorial you will learn how to animate Image set by using Android AnimationDrawable 




loading.xml

res/anim/loading.xml


<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/voipemLoading"
    android:oneshot="false" >

    <item
        android:drawable="@drawable/loading_01"
        android:duration="300"/> 
    <item
        android:drawable="@drawable/loading_02"
        android:duration="300"/>
    <item
        android:drawable="@drawable/loading_03"
        android:duration="300"/>
    <item
        android:drawable="@drawable/loading_04"
        android:duration="300"/>

</animation-list>


DravableAnimation


package com.javasrilankansupport.drawableanimation;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;

public class DravableAnimation extends Activity implements OnClickListener {

 private AnimationDrawable mAnimation;
 private ImageView mAnimLogo;
 private Button mbtnStart;
 private boolean mStart;

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

  mAnimLogo = (ImageView) findViewById(R.id.loading_image);
  mAnimation = (AnimationDrawable) mAnimLogo.getDrawable();
  mbtnStart = (Button) findViewById(R.id.btn_start);

  mbtnStart.setOnClickListener(this);
 }

 @Override
 public void onClick(View v) {
  if (!mStart) {
    // start animation 
   mAnimLogo.post(new Runnable() {
    @Override
    public void run() {
     mAnimLogo.setVisibility(View.VISIBLE);
     mAnimation.start();
     mStart = true;
     mbtnStart.setText("Stop");
    }
   });
  } else {     
   // stop animation            
   mAnimation.stop();
   mbtnStart.setText("Start");
   mStart = false;
  }
 }
}


dravable_animation.xml


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".DravableAnimation"
    android:background="@drawable/bg_login" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="44dp"
        android:text="@string/hello_world"
        android:textColor="@color/black"
        android:textSize="24sp" />

    <ImageView
        android:id="@+id/loading_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="37dp"
        android:src="@anim/loading"
        android:visibility="invisible" />

    <Button
        android:id="@+id/btn_start"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/loading_image"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="48dp"
        android:text="@string/btn_start" />

</RelativeLayout>

Download AnimationDrawable complete source code 




Read more...

How to move an image from left to right and right to left in android

1 comments

Android Animation with TranslateAnimation

In this tutorial you will learn how to animate an image from left to right and right to left in android using TranslateAnimation


Android Animation TranslateAnimation



     ImageView img_animation = (ImageView) findViewById(R.id.img_animation);

        TranslateAnimation animation = new TranslateAnimation(0.0f, 400.0f,
                0.0f, 0.0f);          //  new TranslateAnimation(xFrom,xTo, yFrom,yTo)
        animation.setDuration(5000);  // animation duration 
        animation.setRepeatCount(5);  // animation repeat count
        animation.setRepeatMode(2);   // repeat animation (left to right, right to left )
//      animation.setFillAfter(true);      

        img_animation.startAnimation(animation);  // start animation 


Animation 


package com.javasrilankansupport.animation;

import android.os.Bundle;
import android.app.Activity;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;

public class Animation extends Activity {

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

  ImageView img_animation = (ImageView) findViewById(R.id.img_animation);

  TranslateAnimation animation = new TranslateAnimation(0.0f, 400.0f,
    0.0f, 0.0f);
  animation.setDuration(5000);
  animation.setRepeatCount(5);
  animation.setRepeatMode(2);
  animation.setFillAfter(true);
  img_animation.startAnimation(animation);

 }
}


activity_animation.xml


 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Animation" >
    
    <ImageView
        android:id="@+id/img_animation"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="42dp"
        android:src="@drawable/emo_im_crying" />

</RelativeLayout>



Read more...

Tuesday, June 25, 2013

Android OnKeyListener Example

0 comments
In this post you will learn how to implement Android OnKeyListener with EditText

android onkeylistener javasrilankansupport.com

EditTextKeyListener

EditTextKeyListener class implement the Android OnKeyListener interface





package com.javasrilankansupport.androidkeylistner;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.EditText;
import android.widget.Toast;
import android.app.Activity;

public class EditTextKeyListener extends Activity implements OnKeyListener {

 private EditText userName;
 private EditText password;

 private String mUserName;
 private String mPassword;

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

  userName = (EditText) findViewById(R.id.txt_name);
  password = (EditText) findViewById(R.id.password);

  // set onkeyListner
  userName.setOnKeyListener(this);
  password.setOnKeyListener(this);

 }

 @Override
 public boolean onKey(View v, int keyCode, KeyEvent event) {

  switch (v.getId()) {

  case R.id.txt_name:
   // keyup and "ENTER"
   if ((event.getAction() == KeyEvent.ACTION_DOWN)
     && (keyCode == KeyEvent.KEYCODE_ENTER)) {
    mUserName = userName.getText().toString();
    if (mUserName.equals("")) {
     Toast.makeText(this, "Enter user name...",
       Toast.LENGTH_SHORT).show();

    } else
     password.requestFocus();
   }
   break;

  case R.id.password:
   // keydown and "ENTER"
   if ((event.getAction() == KeyEvent.ACTION_DOWN)
     && (keyCode == KeyEvent.KEYCODE_ENTER)) {
    mPassword = password.getText().toString();
    if (mPassword.equals(""))
     Toast.makeText(this, "Enter password...",
       Toast.LENGTH_SHORT).show();

    else
     // show Toast Long time
     Toast.makeText(
       this,
       "User name : " + mUserName + "  Password : "
         + mPassword, Toast.LENGTH_LONG).show();
   }
   break;

  }
  return false;
 }

}

activity_keylistener.xml


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".EditTextKeyListener" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        android:textSize="20sp" />

    <EditText
        android:id="@+id/txt_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="48dp"
        android:ems="10"
        android:inputType="textPersonName" 
        android:hint="@string/username"
       >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/password"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/txt_name"
        android:layout_below="@+id/txt_name"
        android:layout_marginTop="24dp"
        android:ems="10"
        android:inputType="textPassword"
        android:hint="@string/psass" />

</RelativeLayout>


Download Android KeyListener project

Read more...

Tuesday, March 19, 2013

How to Install Android SDK properly in ubuntu 12.04 amd64

0 comments

Android SDK in ubuntu 12.04 amd64


Android SDK is not working properly in ubuntu 12.04 amd64 , because ubuntu 12.04 64-bit dose not   have  ia32-libs package. So it gives adb error on Eclipse like 

error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

This can solve by installing  the required libraries which is for i386 version 

Open the terminal and execute following command 

sudo apt-get install libncurses5:i386 libstdc++6:i386 libz1:i386 libc6:i386 libsdl1.2debian:i386


NB: 

If you unable to launch Android emulator, execute the following command which will install ia32-libs package

sudo apt-get install ia32-libs




Read more...