Source link:

Para modo de uso em Portugês: JoystickView - Uma view customizada que simula um Joystick no Android.

For more info, go to: JoystickView - A custom Android View to simulates a Joystickm Joystick no Android

JoystickView - Android

Android JoystickView is a Custom View that simulates a Joystick for interactive applications for Android, as simple aim is allows access values ??of angle and power of the virtual Joystck movement.


Quick Usage

1º Step: Download the JAR file at download

2º Step: Create a folder called "libs" on the root of your project and place the JAR file into.

It's enough to reffer and user the JoystickView library

Advanced Usage

If you want to change or upgrade some feature of the library, you should do:

1º Step: Clone the project or download this project to your workspace eclipse IDE, then:

2º Step Go to eclipse' menu FILE, after IMPORT.

3º Step: Now click in "Existing Project into Workspace"

4º Step: Click in Browse e search the source code folder where you placed after clone ou download.

5º Step: Setup with Next or/and Finish, ant the JoystickView is ready to you use in your applications.

6º Step: Import JoystickView in your applications.

To use JoystickView in your applications, simply add the lib to the classpath of your application:

7º Passo: Click with right button on your project go to PROPERTIES -> ANDROID and the ADD.

8º Step: Select JoystickView lib and click OK to finish.


From this point you can inflate the JoystickView in your layouts or referencing it in your Activities.

import com.zerokol.views.JoystickView; import com.zerokol.views.JoystickView.OnJoystickMoveListener; import; import android.os.Bundle; import android.widget.TextView;  public class JoystickViewDemoActivity extends Activity {
  private TextView angleTextView;  private TextView powerTextView;  private TextView directionTextView;  // Importing also other views  private JoystickView joystick;
/** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {



 angleTextView = (TextView) findViewById(;

powerTextView = (TextView) findViewById(;

directionTextView = (TextView) findViewById(;

//Referencing also other views
joystick = (JoystickView) findViewById(;

//Event listener that always returns the variation of the angle in degrees, motion power in percentage and direction of movement
joystick.setOnJoystickMoveListener(new OnJoystickMoveListener() {

 public void onValueChanged(int angle, int power, int direction) {

  // TODO Auto-generated method stub
  angleTextView.setText(" " + String.valueOf(angle) + "°");

  powerTextView.setText(" " + String.valueOf(power) + "%");

  switch (direction) {

  case JoystickView.FRONT:


  case JoystickView.FRONT_RIGHT:


  case JoystickView.RIGHT:


  case JoystickView.RIGHT_BOTTOM:


  case JoystickView.BOTTOM:


  case JoystickView.BOTTOM_LEFT:


  case JoystickView.LEFT:


  case JoystickView.LEFT_FRONT:







This is an implementation of a custom android view that works like a Joystick, this view controls two variables, angle motion and power motion of the screen touch.

JoystickView by AJ Alves is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Based on a work at and page Permissions beyond the scope of this license may be available at

Special Thanks to:

@mksmbrtsh (

@Mayco-Anderson (


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes