Payday Loan Payday Loan

Hi,
For making an gradient background you need to write the following xml called background_gradient.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <gradient
            android:startColor="#E9E9E9"
            android:endColor="#F4F4F4"
            android:angle="90"/>
</shape>

This code you must put it in drawable folder…and call it like this…
let s say you want a background gradient color for your button.

button.setBackgroundResource(R.drawable.background_gradient);
||||| 0 I Like It! |||||

Hi,
I want to show you how you can make a RotateAnimation in android. This rotate animation it will be around the self center.

ImageView refresh = (ImageView)view.findViewById(R.id.refreshimage);
            RotateAnimation anim = new RotateAnimation(0f, 360f,
                    Animation.RELATIVE_TO_SELF, 0.5f,
                    Animation.RELATIVE_TO_SELF, 0.5f);
            anim.setInterpolator(new LinearInterpolator());
            anim.setRepeatCount(Animation.INFINITE);       
            anim.setDuration(1000);
            refresh.startAnimation(anim);
||||| 0 I Like It! |||||

Hi,
This tutorial is about setting an alarm to run a service at some point in the future or at every x minutes.
When an alarm goes off, the system will broadcast the intent that had been registered for that alarm, automatically starting the target application if it is not already running.
You can set an alarm to wake up the device and execute your code if the device is on sleep mode when your alarm is triggered. The AlarmManager will hold a CPU wake lock until the execution of onReceive() method of the alarm receiver ends; this guarantees that the device will not sleep until you have finished handling the broadcast triggered by your alarm.

1. MyAlarm.java

 
    package com.example.alarm;
    import android.app.AlarmManager;
    import android.app.PendingIntent;
    import android.content.Context;
    import android.content.Intent;
 
    public class MyAlarm {
 
     public void SetAlarm(Context context)
     {
         AlarmManager m_alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
         Intent i = new Intent(context, MyService.class); // this intent describe the service to be started
         PendingIntent pi = PendingIntent.getService(context, 0, i, 0);
         m_alarmManager.set(AlarmManager.RTC_WAKEUP, getTriggerTime(), pi);
     }
 
     public void CancelAlarm(Context context)
     {
         AlarmManager m_alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
         Intent i = new Intent(context, MyService.class);
         PendingIntent pi = PendingIntent.getService(context, 0, i, 0);
         m_alarmManager.cancel(pi);
     }
 
     private long getTriggerTime() {
         // let's say we want the alarm to trigger at 12:00 
         Calendar cTime = Calendar.getInstance();
    	 cTime.setTime(new Date());
    	 cTime.set(Calendar.HOUR_OF_DAY, 12);
    	 cTime.set(Calendar.MINUTE, 0);
    	 cTime.set(Calendar.SECOND, 0);
    	 long mTime = cTime.getTimeInMillis();
 
         // if we want that the alarm trigger after 15 min
         // Calendar cTime = Calendar.getInstance();
    	 // cTime.setTime(new Date());
    	 // long mTime = cTime.getTimeInMillis() + 1000 * 60 * 15; millis * sec * min
 
         return mTime;
     }
 }

Because we used the set((int type, long triggerAtMillis , PendingIntent operation)) method of AlarmManager, this alarm will be triggered just one time, if you want it to repeat every “x” minutes, you can use the method setRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) where triggerAtMillis is the time when the alarm will be triggered first time, and intervalMillis is the interval in milliseconds between subsequent repeats of the alarm.

2. MyService.java

 
public class MyService extends Service{
 
    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();
    }
 
    @Override
    public IBinder onBind(Intent arg0) {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
    }
 
    @Override
    public void onStart(Intent intent, int startId) {
        // TODO Auto-generated method stub
        super.onStart(intent, startId);
        Toast.makeText(this, "MyService started", Toast.LENGTH_LONG).show();
    }
 
}

3. MyActivity.java

 
public class MyActivity extends Activity{
 
    @Override
    public void onCreate() {
        super.onCreate();
 
        MyAlarm.SetAlarm(getBaseContext());
    }
 
    public void cancelAlarm() {
        MyAlarm.CancelAlarm(getBaseContext());
    }
}

Don’t forget to declare MyService in your manifest:

 
    <service android:enabled="true" android:name=".MyService" />

Happy coding,
Bogdan

||||| 1 I Like It! |||||

How to animate a view in android

Hi,
This is a very simple and basic animation of a view. Let’s say you have a button and on clicking the button, this will start moving. Also you can move any other views from your layout, but this example shows how to animate this clicked button:

mButton.setOnClickListener(new View.OnClickListener()
{
    @Override
    public void onClick(View view)
    {
        TranslateAnimation animate = new TranslateAnimation(0.0f, 1.0f, 0.0f, 1.0f);
        view.startAnimation(animate);
    }
});
||||| 0 I Like It! |||||

Hi,
Today i want to show you how you can do background tasks and to update UI in the same time after the task is finished.
Let’s say you have a login method that return true if login succesfully and false if not succesfull.
Let’ s see the code:

//here we initialize a ProgressDialog to show while the task is done in background
ProgressDialog mProgressDialog;
		boolean result;
		public class SigninAsync extends AsyncTask<Void, Void, Boolean> {
			@Override
			protected void onPreExecute() {
				mProgressDialog = ProgressDialog.show(SigninPage.this,
						null, "Signing in...", true, false);
			}
 
			@Override 
			protected Boolean doInBackground(Void...voids) {
				result = doLogin();
	                         //observe the use of Boolean so that on PostExecute you can take some action based 
//on the returned result
				return result;
			}
 
			@Override
			protected void onPostExecute(Boolean result) {
				mProgressDialog.dismiss();
				if (result){
                                         //if result successfull go to next page
					Intent intent = new Intent(SigninPage.this, MainPage.class);
					startActivity(intent);
				} else {
				AlertDialog dialog =  new AlertDialog.Builder(SigninPage.this).create();
				dialog.setTitle("Login!");
				dialog.setMessage("Authentication failed! Please check your email and password!");
				dialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK",new DialogInterface.OnClickListener(){
 
					public void onClick(DialogInterface dialog, int wich) {
						// TODO Auto-generated method stub
						dialog.dismiss();
					}});dialog.show();
				}
 
			}
		}

Hope this helps you!

||||| 1 I Like It! |||||

Hi,
I want to show you how to parse JSON in Android:
This is an example of JSON string coming from server:

{
    "schools": [
        {
                "id": "s101",
                "name": "National School",
                "email": "nationalschool@gmail.com",
                "address": "Str.myStreet, nr.33",                
                "phone": {
                    "mobile": "+55 55515515551",
                    "home": "+55 55515515551",
                    "office": "+55 55515515551"
                }
        },
        {
                "id": "s102",
                "name": "Second Scool",
                "email": "secondschool@gmail.com",
                "address": "yourstreet,nr.22",
                "phone": {
                    "mobile": "+55 5555553333",
                    "home": "+55 5555553333",
                    "office": "+55 5555553333"
                }
          }
     ]
}

I will show you how to make parse JSON recieved after you POST login data to server.
the folowing method will do exactly this:

public boolean postData() {
		    HttpClient httpclient = new DefaultHttpClient();
		    HttpPost httppost = new HttpPost("http://yoursite.com/login.php");
 
		    try {
		        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);		        
		        nameValuePairs.add(new BasicNameValuePair("email", "example@mail.com"));
		        nameValuePairs.add(new BasicNameValuePair("password", "123456"));		        
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
 
 
		        HttpResponse response;
 
			response = httpclient.execute(httppost);
 
		        HttpEntity httpEntity = response.getEntity();
	            is = httpEntity.getContent();    
		        Log.v("", "Response from server: " + response.toString());
		    } catch (UnsupportedEncodingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();			
		    } catch (ClientProtocolException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
//Here we have the response from server and we convert it to a JSON Object		 
	            BufferedReader reader;
				try {
					reader = new BufferedReader(new InputStreamReader(
					        is, "iso-8859-1"), 8);
 
	            StringBuilder sb = new StringBuilder();
	            String line = null;
 
					while ((line = reader.readLine()) != null) {
					    sb.append(line + "\n");
					}
 
	            is.close();
 
	            json = sb.toString();
 
 
		    	try {
					jObj = new JSONObject(json);
				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
 
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();			
		        }
		  try {
				//as you observe we get the array called schools..look in example
//then we get the childs for this array..
			jsonArray = jObj.getJSONArray("schools");
			for (int i = 0; i < jsonArray.length();i++) {
				JSONObject c = jsonArray.getJSONObject(i);
				id = c.getString("id");
				Log.d("","VALIDD IS:"+id);
				name= c.getString("name");
                                email = c.getString("email");
 
			}
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//Lets say that if you get id = 1 means that you are logged in and the data come to you for parsing so this
 //function will return true because the login is successfully done.
	    if (Integer.parseInt(id) == 1){
	    	return true;
	    }
	    else {
	    	return false;
	    }
 
		}

If you want you can call this method like this:

if(postData){
//go to screen when the Login is succesfull
}
else {
//show alert that the email and password do not match.
}

If there are any queries please comment and i will answer you. Thanks.

||||| 1 I Like It! |||||

Hi,
This is a simple way of sending a mail from your app. You will use Android default email client and you will send to the app your variables like this.

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"mymail@mail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "Subject");
i.putExtra(Intent.EXTRA_TEXT   , "Body");
try {
    startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
    Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}

Hope this helped you.

||||| 0 I Like It! |||||

Hi,
Here is the simplest mode you can use multiple colors for your text in a Textview.
You need to use HTML formatting like this:

textview.setText(Html.fromHtml("<font color=\"#ffffff\">" + "SCHOOL" +  "</font>" + 
				"<font color=\"#fff000\">" + " BUS" +  "</font>"));

In this way you can use different tags from HTML language so that you can customize the appearance of your text.
Hope is usefull for you.

||||| 0 I Like It! |||||

Hi, this is the best method to find out if there is internet connection on device.
Most important thing is that you need the following permission added:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

The method is:

private boolean isNetworkAvailable() {
    ConnectivityManager connectivityManager 
          = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
    return activeNetworkInfo != null;
}
||||| 0 I Like It! |||||

Hi,
Today i want to show you how you can save like a image file a user gestures. Also you can learn how to draw gestures on a view and also how to erase the gestures.
There is a similar post…but simply do not works plug and play like this improved example.
The following class is an Dialog activity which is just a plug and play class.
Copy and paste and it will work.
All you need are some setups. For example you need to add in your strings/ folder a item called external_dir.
Here will be saved the png image file.
First create a Hello World application. Can look like this:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
 
public class MyApplication extends Activity {
 
    public static final int MY_ACTIVITY = 1;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
 
        Button getSignature = (Button) findViewById(R.id.signature);
        getSignature.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(MyActivity.this, CaptureSignature.class); 
                startActivityForResult(intent,MY_ACTIVITY);
            }
        });
    }
 
    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        switch(requestCode) {
        case MY_ACTIVITY: 
            if (resultCode == RESULT_OK) {
 
                Bundle bundle = data.getExtras();
                String status  = bundle.getString("status");
                if(status.equalsIgnoreCase("done")){
                    Toast toast = Toast.makeText(this, "Signature capture successful!", Toast.LENGTH_SHORT);
                    toast.setGravity(Gravity.TOP, 105, 50);
                    toast.show();
                }
            }
            break;
        }
 
    }  
 
}

As you saw we have called from a button the Activity CaptureSignature…
You need to declare this activity in your manifest like this:

<activity
            android:name=".CaptureSignature"
            android:theme="@android:style/Theme.Dialog"
             />

Also in Manifest you need to add permission to write on SDCARD like this:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

After you have done this modifications you need to create the class CaptureSignature.java
In this file you need the following code:

 
import java.io.File;
import java.io.FileOutputStream;
import java.util.Calendar;
 
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore.Images;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.Toast;
 
public class CaptureSignature extends Activity { 
 
    LinearLayout mContent;
    Signature mSignature;
    Button mClear, mGetSign, mCancel;
    public static String tempDir;
    public int count = 1;
    public String current = null;
    private Bitmap mBitmap;
    View mView;
    File mypath;
 
    private String uniqueId;
    private EditText yourFileName;
 
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.signature);
 
        tempDir = Environment.getExternalStorageDirectory() + "/" + getResources().getString(R.string.external_dir) + "/";
        ContextWrapper cw = new ContextWrapper(getApplicationContext());
 
        prepareDirectory();
        yourFileName = (EditText) findViewById(R.id.yourName);
 
 
 
        mContent = (LinearLayout) findViewById(R.id.linearLayout);
        mSignature = new Signature(this, null);
        mSignature.setBackgroundColor(Color.WHITE);
        mContent.addView(mSignature, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
        mClear = (Button)findViewById(R.id.clear);
        mGetSign = (Button)findViewById(R.id.getsign);
        mGetSign.setEnabled(false);
        mCancel = (Button)findViewById(R.id.cancel);
        mView = mContent;
 
 
 
        mClear.setOnClickListener(new OnClickListener() 
        {        
            public void onClick(View v) 
            {
                Log.v("log_tag", "Panel Cleared");
                mSignature.clear();
                mGetSign.setEnabled(false);
            }
        });
 
        mGetSign.setOnClickListener(new OnClickListener() 
        {        
            public void onClick(View v) 
            {
                Log.v("log_tag", "Panel Saved");
                boolean error = captureSignature();
                if(!error){
                    mView.setDrawingCacheEnabled(true);
                    mSignature.save(mView);
                    Bundle b = new Bundle();
                    b.putString("status", "done");
                    Intent intent = new Intent();
                    intent.putExtras(b);
                    setResult(RESULT_OK,intent);   
                    finish();
                }
            }
        });
 
        mCancel.setOnClickListener(new OnClickListener() 
        {        
            public void onClick(View v) 
            {
                Log.v("log_tag", "Panel Canceled");
                Bundle b = new Bundle();
                b.putString("status", "cancel");
                Intent intent = new Intent();
                intent.putExtras(b);
                setResult(RESULT_OK,intent);  
                finish();
            }
        });
 
    }
 
    @Override
    protected void onDestroy() {
        Log.w("GetSignature", "onDestory");
        super.onDestroy();
    }
 
    private boolean captureSignature() {
 
        boolean error = false;
        String errorMessage = "";
 
 
        if(yourFileName.getText().toString().equalsIgnoreCase("")){
            errorMessage = errorMessage + "Please enter your FileName\n";
            error = true;
        } else {
        	uniqueId = getTodaysDate() + "_" + getCurrentTime() + "_"+yourFileName.getText().toString();
            current = uniqueId + ".png";
            mypath= new File(tempDir,current);
        }
 
        if(error){
            Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);
            toast.setGravity(Gravity.TOP, 105, 50);
            toast.show();
        }
 
        return error;
    }
 
    private String getTodaysDate() { 
 
        final Calendar c = Calendar.getInstance();
        int todaysDate =     (c.get(Calendar.YEAR) * 10000) + 
        ((c.get(Calendar.MONTH) + 1) * 100) + 
        (c.get(Calendar.DAY_OF_MONTH));
        Log.w("DATE:",String.valueOf(todaysDate));
        return(String.valueOf(todaysDate));
 
    }
 
    private String getCurrentTime() {
 
        final Calendar c = Calendar.getInstance();
        int currentTime =     (c.get(Calendar.HOUR_OF_DAY) * 10000) + 
        (c.get(Calendar.MINUTE) * 100) + 
        (c.get(Calendar.SECOND));
        Log.w("TIME:",String.valueOf(currentTime));
        return(String.valueOf(currentTime));
 
    }
 
 
    private boolean prepareDirectory() 
    {
        try
        {
            if (makedirs()) 
            {
                return true;
            } else {
                return false;
            }
        } catch (Exception e) 
        {
            e.printStackTrace();
            Toast.makeText(this, "Could not initiate File System.. Is Sdcard mounted properly?", 1000).show();
            return false;
        }
    }
 
    private boolean makedirs() 
    {
        File tempdir = new File(tempDir);
        if (!tempdir.exists())
            tempdir.mkdirs();
 
        if (tempdir.isDirectory()) 
        {
            File[] files = tempdir.listFiles();
 
        }
        return (tempdir.isDirectory());
    }
 
    public class Signature extends View 
    {
        private static final float STROKE_WIDTH = 5f;
        private static final float HALF_STROKE_WIDTH = STROKE_WIDTH / 2;
        private Paint paint = new Paint();
        private Path path = new Path();
 
        private float lastTouchX;
        private float lastTouchY;
        private final RectF dirtyRect = new RectF();
 
        public Signature(Context context, AttributeSet attrs) 
        {
            super(context, attrs);
            paint.setAntiAlias(true);
            paint.setColor(Color.BLACK);
            paint.setStyle(Paint.Style.STROKE);
            paint.setStrokeJoin(Paint.Join.ROUND);
            paint.setStrokeWidth(STROKE_WIDTH);
        }
 
        public void save(View v) 
        {
            Log.v("log_tag", "Width: " + v.getWidth());
            Log.v("log_tag", "Height: " + v.getHeight());
            if(mBitmap == null)
            {
                mBitmap =  Bitmap.createBitmap (mContent.getWidth(), mContent.getHeight(), Bitmap.Config.RGB_565);;
            }
            Canvas canvas = new Canvas(mBitmap);
            try
            {
                FileOutputStream mFileOutStream = new FileOutputStream(mypath);
 
                v.draw(canvas); 
                mBitmap.compress(Bitmap.CompressFormat.PNG, 90, mFileOutStream); 
                mFileOutStream.flush();
                mFileOutStream.close();
            //    String url = Images.Media.insertImage(getContentResolver(), mBitmap, "title", null);
             //   Log.v("log_tag","url: " + url);
                //In case you want to delete the file
                //boolean deleted = mypath.delete();
                //Log.v("log_tag","deleted: " + mypath.toString() + deleted);
                //If you want to convert the image to string use base64 converter
 
            }
            catch(Exception e) 
            { 
                Log.v("log_tag", e.toString()); 
            } 
        }
 
        public void clear() 
        {
            path.reset();
            invalidate();
        }
 
        @Override
        protected void onDraw(Canvas canvas) 
        {
            canvas.drawPath(path, paint);
        }
 
        @Override
        public boolean onTouchEvent(MotionEvent event) 
        {
            float eventX = event.getX();
            float eventY = event.getY();
            mGetSign.setEnabled(true);
 
            switch (event.getAction()) 
            {
            case MotionEvent.ACTION_DOWN:
                path.moveTo(eventX, eventY);
                lastTouchX = eventX;
                lastTouchY = eventY;
                return true;
 
            case MotionEvent.ACTION_MOVE:
 
            case MotionEvent.ACTION_UP:
 
                resetDirtyRect(eventX, eventY);
                int historySize = event.getHistorySize();
                for (int i = 0; i < historySize; i++) 
                {
                    float historicalX = event.getHistoricalX(i);
                    float historicalY = event.getHistoricalY(i);
                    expandDirtyRect(historicalX, historicalY);
                    path.lineTo(historicalX, historicalY);
                }
                path.lineTo(eventX, eventY);
                break;
 
            default:
                debug("Ignored touch event: " + event.toString());
                return false;
            }
 
            invalidate((int) (dirtyRect.left - HALF_STROKE_WIDTH),
                    (int) (dirtyRect.top - HALF_STROKE_WIDTH),
                    (int) (dirtyRect.right + HALF_STROKE_WIDTH),
                    (int) (dirtyRect.bottom + HALF_STROKE_WIDTH));
 
            lastTouchX = eventX;
            lastTouchY = eventY;
 
            return true;
        }
 
        private void debug(String string){
        }
 
        private void expandDirtyRect(float historicalX, float historicalY) 
        {
            if (historicalX < dirtyRect.left) 
            {
                dirtyRect.left = historicalX;
            } 
            else if (historicalX > dirtyRect.right) 
            {
                dirtyRect.right = historicalX;
            }
 
            if (historicalY < dirtyRect.top) 
            {
                dirtyRect.top = historicalY;
            } 
            else if (historicalY > dirtyRect.bottom) 
            {
                dirtyRect.bottom = historicalY;
            }
        }
 
        private void resetDirtyRect(float eventX, float eventY) 
        {
            dirtyRect.left = Math.min(lastTouchX, eventX);
            dirtyRect.right = Math.max(lastTouchX, eventX);
            dirtyRect.top = Math.min(lastTouchY, eventY);
            dirtyRect.bottom = Math.max(lastTouchY, eventY);
        }
    }
}

Now you will need the xml file called signature.xml
This is the code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/linearLayout1"
    android:layout_width="fill_parent" android:layout_height="400dp"
    android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout android:layout_height="wrap_content"
        android:id="@+id/linearLayout2" android:layout_width="match_parent">
        <Button android:layout_height="50dp" android:layout_weight=".30"
            android:text="@string/cancel" android:layout_width="0dp" android:id="@+id/cancel" />
        <Button android:layout_height="50dp" android:layout_weight=".35"
            android:text="@string/clear" android:layout_width="0dp" android:id="@+id/clear" />
        <Button android:layout_height="50dp" android:layout_weight=".35"
            android:text="@string/save" android:layout_width="0dp" android:id="@+id/getsign" />
    </LinearLayout>
    <TableLayout android:layout_height="wrap_content"
        android:id="@+id/tableLayout1" android:layout_width="match_parent">
        <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <TextView android:layout_height="wrap_content" android:id="@+id/textView2"
                android:text="@string/filename" android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_width="wrap_content" android:paddingLeft="10sp"
                android:layout_gravity="left" />
 
        </TableRow>
        <TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        <EditText android:layout_height="wrap_content" android:id="@+id/yourName"
                android:layout_weight="1" android:layout_width="match_parent"
                android:hint="@string/signature_hint"
                android:maxLength="30">
                <requestFocus />
            </EditText>
        </TableRow>
        <TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content"
            android:layout_height="wrap_content">
 
            <TextView android:layout_height="wrap_content" android:id="@+id/textView5"
                android:text="@string/sign_below" android:maxLength="30"  
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_width="wrap_content" />
        </TableRow>
    </TableLayout>
    <LinearLayout android:layout_height="match_parent"
        android:id="@+id/linearLayout" android:layout_width="match_parent" />
</LinearLayout>

Here you will need to update the strings in your string/ folder
but i can give you a hint on how it looks at mine

<resources>
<string name="app_name">Myapp</string>    
<string name="external_dir">WeJob</string>
    <string name="filename">Filename:</string>
    <string name="signature_hint">Ex: mySignature</string>
    <string name="sign_below">Please sign below...</string>
    <string name="cancel">Cancel</string>
    <string name="clear">Clear</string>
    <string name="save">Save</string>
</resources>

Thanks and happy coding!

||||| 0 I Like It! |||||

Search

Popular

Sponsors