How do I add functioning arrow keys into a game in eclipse?

Beankbathevek

New Member
I am VERY new to android development and I watched a lot of tutorials on YouTube and I feel like its time to start testing what I can do. so I thought as a test and a learning experience, i can make a simple game where I just make a image view move left and right on a screen. So again, since I am very new, i'm not sure how to do that. So after watching some tutorials, this is what I set up in my java.\[code\]package com.example.turtle;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.ImageView;public class Backos extends Activity {Button left, right;ImageView turtel;@Overrideprotected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.backos); left = (Button) findViewById(R.id.bLeft); right = (Button) findViewById(R.id.bRight); turtel = (ImageView) findViewById(R.id.ivTurtel); left.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub} });}\[/code\]and here is a pic of my XML in landscapehttp://imgur.com/a/BY24Lyes, i realize it is very stupid but its just a test. i made it in about 10 minutes.
 
Back
Top