[android-developers] Drawing app

2012-07-09 Thread sandeep_c24
I want to develop a drawing app to allow users to draw simple shapes using 
gestures. Is there any framework out there that can be used? I am having a 
look at LibGdx but it is mainly for gaming, will it do the job?


Sandeep

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] DRAWING APP

2012-07-10 Thread mechaman
Hey,

I am new and just got a droid. I am working on a project and need to be 
able to track the coordinates that the user draws on the screen of my app. 
So basically I want an array of coordinates to be constantly updated of 
whatever the user draws on the screen of the app. Is there any prewritten 
code or APIs that would be useful to me?

Let me know!
Thank you! :D

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Drawing App

2010-12-03 Thread Cruiz
I have two Classes (Draw and DrawView)  I'm trying to get the buttons
to function.  The buttons need to change stroke color, change stroke
width, undo redo, erase and etc...  I can see the buttons in emulator
but cannot get them to function.

Someone please help..this is diving me crazy...I'm fairly new to
android app development.

Here is what I have...


package com.example;

import android.app.Activity;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Toast;


public class Draw extends Activity implements OnClickListener {
 DrawView drawView;
 private Paint currentPaint = new Paint();



 @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
drawView = new DrawView(this, null);

// Set full screen view hiding the status bar
getWindow().setFlags
   (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

   // Shows the title
requestWindowFeature(Window.FEATURE_NO_TITLE);

//uses the main.xml layout
   setContentView(R.layout.main);


}


@Override
public void onClick(View view) {
//super.onClick(view);
switch (view.getId()) {
case R.id.blackbutton:
showToastMessage("Color Black");  // message when 
button is
clicked
currentPaint = new Paint();
currentPaint.setAntiAlias(true);
currentPaint.setColor(Color.RED);
currentPaint.setStyle(Paint.Style.STROKE);
currentPaint.setStrokeJoin(Paint.Join.ROUND);
currentPaint.setStrokeCap(Paint.Cap.ROUND);   // round 
stroke
ends on start and stop
currentPaint.setStrokeWidth(5);
break;
case R.id.redbutton:
showToastMessage("Color Red");
break;
case R.id.greenbutton:
showToastMessage("Color Green");
break;
case R.id.bluebutton:
showToastMessage("Color Blue");
break;
case R.id.undobutton:
showToastMessage("Undo");
break;
case R.id.erasebutton:
showToastMessage("Eraser");
break;
case R.id.clearbutton:
showToastMessage("Screen Cleared");
setContentView(R.layout.main);
break;
}
}
  private void showToastMessage(String msg){
  Toast toast = Toast.makeText(this, msg, 
Toast.LENGTH_SHORT);
  toast.setGravity(Gravity.TOP|Gravity.TOP, 0, 50);
  toast.show();
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
}


\

// DrawView is a view. It listens to mouse click events and draws a
point at the point that it was clicked on.

package com.example;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;


public class DrawView extends View {
  private Paint currentPaint = new Paint();
  private Path path = new Path();


  /**
   * Optimizes painting by invalidating the smallest possible 
area.
   */
  private float lastTouchX;
  private float lastTouchY;
  private final RectF dirtyRect = new RectF();

  public DrawView(Context context, AttributeSet attrs) {
super(context, attrs);

currentPaint.setAntiAlias(true);
currentPaint.setColor(Color.MAGENTA);
currentPaint.setStyle(Paint.Style.STROKE);
currentPaint.setStrokeJoin(Paint.Join.ROUND);
currentPaint.setStrokeCap(Paint.Cap.ROUND);
currentPain

Re: [android-developers] DRAWING APP

2012-07-10 Thread TreKing
On Thu, Jul 5, 2012 at 9:29 PM, mechaman  wrote:

> Is there any prewritten code or APIs that would be useful to me?


Yes. The Android SDK.

Your requirement is very specific. If you're hoping for some magical piece
of code that does exactly what you want with no effort on your part, you're
probably out of luck.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Drawing App

2010-12-03 Thread TreKing
On Thu, Dec 2, 2010 at 11:27 AM, Cruiz  wrote:

> I can see the buttons in emulator but cannot get them to function.
>

What does "can't get them to function" mean, exactly?


> Someone please help..this is diving me crazy...I'm fairly new to android
> app development.
>
> Here is what I have...
>

Are you setting click listeners for your buttons?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en