Android :: Can View Appear At Location Where User Touches Screen

Nov 19, 2010

I'm new to android development. Is it possible for a view (with a particular layout) to "appear" at the location where the user "touches"? If so, how? Like the idea of right-clicking on your computer - a menu pops down wherever you right-click and when you navigate away, it disappears.

Android :: Can View Appear at Location where User Touches Screen


Android :: Draw Circle When User Touches Screen

Aug 1, 2009

I've this code:

Java: (http://nopaste.me/4449 )
package com.patrick.games.whackgroundhog; import android.app.Activity;
import android.content.Context; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Paint;
import android.os.Bundle; import android.view.MotionEvent; import android.view.View;
public class Game extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(new Ground(this));
} class Ground extends View { public Ground(Context context) { super(context);
} public void onDraw(Canvas canvas) { canvas.drawColor(Color.BLACK);
} @Override public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
//TODO: draw the circle } return true;
} } }

View 2 Replies View Related

Android :: Changing Drawing With OpenGl When User Touches Screen

Nov 10, 2010

I'm developing an Android application. I'm very new on it. I have the following classes:
class CustomGLSurfaceView extends GLSurfaceView
class CustomRenderer implements GLSurfaceView.Renderer
CustomGLSurfaceView uses CustomRenderer to render a cube on onDrawFrame method.

I've added an onTouchEvent(MotionEvent event) on CustomGLSurfaceView to manage touch events:
class CustomGLSurfaceView extends GLSurfaceView {
// For touch inputs - previous touch (x, y)
private float previousX; private float previousY;
private CustomRenderer myRenderer; public CustomGLSurfaceView(Context context) {
super(context); myRenderer = new CustomRenderer(); setRenderer(myRenderer);
} @Override public boolean onTouchEvent(MotionEvent event) {
float currentX = event.getX(); float currentY = event.getY();
switch (event.getAction()) { case MotionEvent.ACTION_MOVE:
myRenderer.handleMovement(currentY, currentY, previousX, previousY);
} // Save current x, y
previousX = currentX; previousY = currentY;
return true; // Event handled } }

May I have to modify onDrawFrame to draw something new or to rotate the cube? I thing I must do it on handleMovement.

View 1 Replies View Related

Android : Application And Have Multiple Images - Need To Switch When User Touches The Screen

Feb 4, 2009

Here is the problem, I am building an application and have multiple images that need to switch when the user touches the screen, doesn't matter where the users touches. The press the screen and the images switch randomly. I purchased the ebook "Professional Android Application Development" and have torn though it. I am stumped. I'm thoroughly confused at this point. Any ideas on where I can go or how I can accomplish this?

View 11 Replies View Related

Android :: Detecting User's Touches Over An OpenGL Square

Nov 11, 2010

I'm developing an Android application.I'm also working with OpenGL graphics.I have a square drawn on the screen and I want to let user move it when he touches over it. In other words, user should be able to move square when he puts his finger on the square.If he touches outside the square nothing happens.How can I detect when user touches over square?

View 2 Replies View Related

Android :: Rotated Map View - Get The Touches Back To Where They Belong

Feb 24, 2010

I am using the MapsDemo example for a mapping application where I rotate the map in direction of travel. This works well even without the canvas smoothing in the example.

However, I haven't yet managed to adjust the dispatchTouchEvent code to counter the map rotation effect for the user touches (right now when the map is rotated 90 degrees a user's horizontal sweep will move the map vertically etc). The sample code only offers the teaser:

CODE:..........

And while I am at it - Is it still possible to position the zoom controls separately, so that they do NOT rotate when the map rotates? I read that the getZoomControls() is deprecated.

View 2 Replies View Related

Android : Location On Screen Coordinates Of A View?

Mar 22, 2009

I am developing a game in android and i want to capture screen coordinates of a view(ImageView) which is embedded in frame.

Hierarchy is <LinearLayout android android:layout_height="fill_parent" android:layout_width="fill_parent" > <RelativeLayout android:layout_height=fill_parent" android:layout_width="fill_parent" > <FrameLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/frame14"></ FrameLayout> </RelativeLayout> </LinearLayout>

At run time i am attaching two image views for frame layout.I wanted to capture screen coordinates of frame layout.But Couldnt do it.if i say

(FrameLayout) f=(FrameLayout)findViewById(R.id.frame14); int[] loc = new int[2]; f.getLocationOnScreen(loc); System.out.println(loc[0]); System.out.println(loc[1]);

I get Null Pointer Exception for getLocationOnScreen() method.

If I try to get f.getLeft() and f.getRight() they return as 0 coordinates.

Can anyone please tell me how to find location on screen of a view.

View 2 Replies View Related

Android :: Intercepting Screen Touches During Game

Jun 15, 2010

What's the best way of intercepting screen touches and coords during a game loop? At this point, I don't have a View from my main.xml file, so the normal OnTouchEvent doesn't apply, as far as I can tell. What's the usual procedure for this?

View 2 Replies View Related

HTC Incredible :: Phantom Screen Touches A Little

Apr 29, 2010

Mine just started registering phantom screen touches a little while ago.It seems to think there is either and up-swipe or some kind of touch near the top of the screen randomly. For example, an email or list will constantly be scrolling up or if I leave it on a screen with Power Panel on it, one of the icons will randomly highlight orange. The page with the google search widget will have the search field highlight orange on it's own too. When entering text, the cursor will randomly jump back to the beginning.

View 6 Replies View Related

HTC EVO 4G :: Cheek Touches Screen And Changes Stuff While Talking

Jun 24, 2010

I've never had a smartphone YET, but my daughter has a Droid and says she hates that when talking on it, her cheek touches the screen and changes stuff while talking. She's new to the phone itself, so is she doing something wrong or is this just a con of smartphones? Or is this a Droid thing and not an EVO thing?

View 13 Replies View Related

HTC Desire HD :: Screen Detecting Ghost Touches

Nov 24, 2010

After much waiting for my desire HD I was (and am) really pleased with it. However in the last couple of days my screen appears to be detecting a second touch which pretty much prevents me playing games and is a real hindrance when typing. I could accept this if it were the gel protector or my hand running over the side of the screen, but it seems to be around the "rtuio" bit of the keyboard when holding the phone in portrait mode (i.e. the centre). I do have a screen protector on there but there are no air bubbles or anything visible underneath it. So yeah, has this been raised before? I couldn't find anything. Do I need to recalibrate the screen somehow?

View 1 Replies View Related

General :: Touch Screen Doesn't Respond On Touches

Apr 5, 2014

I have a xi electronics chinese crappy tablet, it came pre rooted. So I changed he cpu governor and I pressed apply, after that it stuck , and I needed to reboot using power and vol -It booted up but now my TouchScreen doesnt respond on my touches!, I have already tried factory reset using adb , didn't work.

View 8 Replies View Related

Android :: Adding Child View At Particular Location In Parent View

Mar 20, 2010

I need to draw a child view containing a rectangle and button on top of the content view at particular location on the parent (content view). How can I do this? Did not find an explicit way to set origin of child view?

View 1 Replies View Related

Android :: How To Find Geo Location Of User?

Apr 30, 2010

I am developing a webpage which requires the user location for loading some data. The web page is mainly intended for android users. I need to find the geo location of the user when the user opens that page? How can I do that?

View 2 Replies View Related

Android :: Using XMPP For User Location

Apr 27, 2010

I want to create an application for Android that enables me to get the geolocation of a user. This has to be made as a client-server app and for the server side I'm using OpenFire. For getting the user's location I would have to use XEP-0080, right? And SmackAPI also? I'm completely new to XMPP and Smack, so if anyone could get me a few pointers or maybe examples or any kind of documentation about this I'd be very grateful.

View 1 Replies View Related

Android :: Need Most Robust Way To Get User's Current Location?

Jun 29, 2010

The LocationManager API in android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location.The app I'm working on isn't really a location app per se, but it does need to get the user's location in order to display a list of nearby businesses. It doesn't need to worry about if the user is moving around or anything like that.Show the user a list of nearby locations.Preload the user's location so that by the time I need it in Activity X, it will be available. Don't particularly care about accuracy or frequency of update. Just grabbing one location is sufficient as long as it's not way off. Maybe if I want to be fancy I'll update the location once every few mins or so, but it's not a huge priority.
Work for any device as long as it has either a GPS or a Network Location provider.

View 5 Replies View Related

Android :: Google Maps Let User Choose Location

Aug 28, 2010

I've been working on an application lately that is using GMaps to display a location that is stored in the devices database. However when no location is available (no GPS signal is available) the user can go through an edit wizard and at a certain point he can add a location himself. I already have to code to display the stored location, but is it possible to write something so the user get's to see a map and when he clicks/touches on a certain area a map pointer appears and the location is stored. Is that possible in any way? Is there any good online documentation available? I searched through this group and on Google but couldn't find anything usefull.

View 2 Replies View Related

Android :: User Preference Data Location In Windows

Apr 15, 2010

I'm using Windows to develop android apps and want to know where user preference data is located. It says at /data/data/package/...., but where can I actually see the preference file? Via eclipse or command line tools?

View 1 Replies View Related

Android :: Using Google Maps API To Guide User To Location

May 31, 2010

I'm having trouble trying to find a way to guide a user from one point on a map to another. I can add the locations I want to the overlay. I want the user to be able to pick a location and be guided through the streets to that location. Does anyone know how to do this, or is it even available in the API?

View 3 Replies View Related

Android :: Way To Accurately Determine Which City In US The User Is In Using Location Manager

Oct 14, 2010

I am trying to determine the city in USA the user is in using their current location from an Android App. I want to use the GPS as the location provider but how accurately can I determine the name of the city from the Locale or Latitude / Longitude data.

For instance I noticed the twitter app determines you are in Manhattan when tweeting from Manhattan, but is it possible to retrieve New York City instead of Manhattan from the location data and likewise Los Angeles instead of Beverly Hills.

This is because all I need to determine is which city the user is in as per the current location.

View 1 Replies View Related

Android :: Detect User's Location From Webpage Opened In Browser?

Dec 24, 2009

Visiting www.google.com on the Android browser (or even with an android spoofed user-agent), presents the option to "Share Location". When clicked, it uses the GPS/Cell phone towers to figure out the location. I tried the google.loader.clientLocation but that only works using the IP address. Is there a method to tap into the Android OS and access GPS data from a regular web application (and not an Android application) similar to the way Google does? [Perhaps Google uses the Google Gears app on Android to access this data.]

View 3 Replies View Related

General :: Nexus 7 - Kitkat Second User Cannot Get Location

Dec 4, 2013

Using custom kitKat ROM on nexus 7 and it's great. The only problem I have is that the full 2nd user cannot find the location in weather apps or GPS test BUT... 2nd user can get location using Google maps???

View 1 Replies View Related

Android :: Web View User Clicks On Particular Url - How Can I Achieve This?

Jun 24, 2009

I have a webview and need to trigger a function when a user clicks on particular url. How can I achieve this?

View 5 Replies View Related

Android :: Detect When User Taps On View?

Jan 10, 2010

I want to detect when a user taps anywhere in a view in my Android application. My code looks like this:

linearLayout = (LinearLayout) findViewById(R.id.linearLayout); // main layout
// ...
linearLayout.setOnTouchListener(this);
// ...
public boolean onTouch(View v, MotionEvent event) {
Toast.makeText(this, "Touch!", 1000);
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Toast.makeText(this, "Down!", 1000);
return true;
}
return false;
}

but when I click on the view, I don't get Toast! Do touch events work in the emulator -- or have I got something wrong in my code?

View 2 Replies View Related

Android :: Any Intent To View User Twitter Feed In Application?

Sep 29, 2010

I have a user's twitter handle. Right now I'm opening it through a web page like:
String url = "http://www.twitter.com/" + "example_handle";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);

If the user has the Twitter android app installed, is there a different intent I can use which gives the user the option to view that user's twitter feed in the Twitter app, instead of forcing them directly to a browser? I'm not sure if the author's of the Twitter app have exposed any such intent.

View 2 Replies View Related

Android :: Get Point / Coordinate User Clicked On Droid View?

Sep 7, 2010

I have an imageview and when clicked, calls OnClickListener.onClick(View v). How do I get the exact point/coordinate that the user clicked?

View 1 Replies View Related

Android :: Allow Anyone To View My Current Geographical Location Online?

Aug 8, 2010

I moved out of state for college & work, and whenever I am making the 8 hour drive home people are constantly bugging me about how far I am and when I'll be arriving. I don't really like texting or talking while I'm driving, so I'm looking for an app to help me out.

Is there an application that could post my current location on google maps whenever I have the app running?

Bonus points if it could be integrated into a navigation app somehow to show my trip route and basic information (e.g. how long I've been driving and estimated time of arrival).

You guys know of anything like this? Basically I want to be able to send a url to my friends or family to monitor my location.

View 4 Replies View Related

Android : Need To Append TextViews To Current View Whenever User Hits On Button

Jun 1, 2009

I need to append a new TextView to the current View whenever a user hits on a button.

View 7 Replies View Related

Android :: Setting Acquired Location To Text View - How To Maintain?

May 8, 2010

I have built an app for the Motorola Droid which should automatically update a server with the phone's location. After the user performs a particular task on the main activity screen, an alarm is set to update the user's location periodically, using a service. The alarm is explicitly stopped when the user completes another task. Thing is, I have set up a location manager within the main activity's onCreate() method which is supposed to place the first acquired lat/long into two textview fields. Even though the manifest is set up for acquiring coarse and fine coords and I'm using requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener), with minTime and minDistance set to zero, I'm not seeing the coords coming up on the screen.

With that, I'm not recording any locations on the server. When I seed the textviews with sample coords, they are being recorded fine on the server. I am not at a computer that can run the IDE, so don't currently have the code, but am desperate for some help on this. One other thing is that the main activity screen calls a photography app before the user manually clicks "send data". I'm suspicious that I may need to override the main activity's onResume() method to do this location acquisition.

View 2 Replies View Related

Android : How To Know Screen Position Where User Touched Screen?

Sep 7, 2010

In my app I draw an image covering the entire screen. I want to now how can I know where the user touched the screen?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved