Android :: Complex Object Collision Detection

Nov 29, 2009

I am currently working on a collision detection routine for an Android based game which is capable of handling complex concave curves in 2D. I use complex in this post to describe any non-trivial, arbitrary shape (beyond circles, squares, etc). My problem is that all of the various methods I have come across are either too simplistic to be realistic or too complex for a cell phone. At the moment I am favoring a tile-based scheme but I am having problems figuring out how to do this with convex curves that span several tiles and may have several line segments per tile. I gave some thought to representing the curves mathematically, with each tile being an interval of the function, but there will likely be points where the curve doubles-back on itself (think the big loop at the top of a pinball table that brings the ball all the way around the table and back the direction it came). My questions boil down to:

1. Does anyone know of a way of hit testing a given simple shape (e.g. a circle) against a concave series of line segments (shapes beyond circles can be figured out from there) beyond just a Boolean result?

2. What is the best way to represent large, complex shapes programatically? I am currently favoring an XML file describing my levels and the objects in them with shape/position/physics/etc. data to be parsed in during load time.

3. Is there an altogether better way of doing this beyond line segments?

The one saving grace in this conundrum is that I know the vast majority of the objects are stationary with, at most, three or four (usually one) dynamic objects moving around.

Android :: Complex Object Collision Detection


Android :: Spinner With A Complex Object

Aug 3, 2010

All the examples I have found assume that Spinner is given an array of String. I have a Spinner whose Adapter contains an Object more complex than a String. I want the capacity to display some parts of this object. a) during drop down b) when the item is selected. Nothing fancy, just some straight text, but I need ot whole object. If I override Adapter#getView, the View that super#getView returns is a TextView, so I could set that to be some relevant text value, but it feels kind of undocumented. I did try inflating a layout containing 2 TextViews and populating them, but UI became a bit screwed up. I'm not really sure what's ok to change here and what's not. Likewise, the above presumably applies to the drop down view, but I am also not sure how to render the selected item.

View 4 Replies View Related

Android :: Complex ListView Example With Complex Data / Layout Of Each Row?

Feb 16, 2010

Im pulling a list of product objects from a database call and I want to build a ListView of the data in my activity with a non-scrolling header and footer. Each row will consist of a product thumbnail, some data and a button arranged horizontally. I understand that using the ListView I can inflate each row using a separate layout. Most of the examples Ive seen using ListView just show a simple array of strings that fill the whole view of the activity, but most real-world examples will be more complex and I can't find any good examples that explain how all these pieces fit together. Does anyone have any pointers to sample code with a good explanation ?

View 2 Replies View Related

Android :: How Can I Get Current Activity Object In Instrumentation Object?

Sep 9, 2009

I want to do some automated testcase with Instrumentation . Suggest that my AUT has 2 Activity. After clicking the button in ther first Activity, the second one will be shown with new content base on what we enter in the first Activity.) Instrumentation provides us the function called startActivitySync() and return the Activity object for processing. My question is how we can get the pointer of the second Activity after the it is shown by clicking the button on the first activity.?

View 2 Replies View Related

Android :: Cast Picture Object To Bitmap Object

Jun 8, 2009

I would like to convert a Picture object to Bitmap object in memory, without writing data to disk.

View 2 Replies View Related

Android : Get Activity Object From Intent Object

Sep 21, 2009

I have an Activity that running on system. I can get the Intent that is used to start the activity. But i don't know how to get the Activity object from the Intent object or something else. Can anyone tell me how to do this??? Note that, I don't use Instrumentation object.

View 11 Replies View Related

Android :: Complex Tab Indicators

Mar 7, 2010

I have a TabHost that requires indicators more complex than a simple string label (the tab itself, not the contents of the tab). There is no graphics involved, just font size and layout of text. The documentation suggests I may call the setIndicator method with a View instead of a CharSequence, but do not provide any pattern to follow. This almost works -- the tabs function but are not colored properly. I can probably use OnTabChangeListener to set their background color to white or black, but clearly this is wrong also -- the orange color transitions, etc. are lost. I just want the existing label behavior on text that's laid out. What pattern should I be following here?

View 3 Replies View Related

Android :: WCF With Complex Types

May 10, 2010

I made the connection between my service WCF and my app android. But i'm wondering if u have ideas about using complex types (classes created on the server side). should i implement the serialization process? or should i juts create the classes on my client side(android)

View 8 Replies View Related

Android :: 1.5 Bug With Earphone Detection

May 5, 2009

On my Google dev phone there is a problem with the new 1.5 version in combination with an official HTC adapter cable YC A300 and 3.5mm earphones. Android doesn't recognize the earphones (it worked on 1.1!). Android still recognizes the HTC earphones with ExtUSB.

View 2 Replies View Related

Android :: How To Use Accelerometer Detection

May 20, 2010

I want to know how to calculate the accelerometer movement.When i place the mobile horizontally in idle state and similarly when i place the mobile in hands,So there accelerometer value change when it is place horizontally or while it is in hand vertically.How To Identify them,Any Sample Codes will be useful.

View 1 Replies View Related

Android :: Shake Detection On Emulator

Apr 30, 2010

I am pretty new to android. I have a use case where I need to detect a shake and show some images in my application. Can I test shake functionality on android emulator ? What are the other alternatives apart from testing it on a real phone ?

View 1 Replies View Related

Android :: Motion Detection Using Camera?

Jun 6, 2010

Is this possible? How do i do it? I want to learn but dont know where to begin even

View 3 Replies View Related

Android :: Sobel Edge Detection

May 30, 2010

As part of an application that I'm developing for Android I'd like to show the user an edge-detected version of an image they have taken (something similar to the example below).To achieve this I've been looking at the Sobel operator and how to implement it in Java. However, many of the examples that I've found make use of objects and methods found in AWT (like this example) that isn't part of Android.My question is then really, does Android provide any alternatives to the features of AWT that have been used in the above example? If we were to rewrite that example just using the libraries built into Android, how would we go about it?

View 1 Replies View Related

Android :: Accelerometer False Detection

Oct 27, 2009

I have a code snippet to detect accelerometer movements. It works some times by properly detecting slight movements, but sometimes it detects movements when I kept my device idle too. Are there any problems with built-in accelerometer detection on Android?

I use an HTC G-1 device. My code snippet is below. How do I resolve it so I can detect small device movements but not detect anything when the device is idle?

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

View 3 Replies View Related

Android :: Ksoap2 Complex Parameter

Nov 29, 2009

I need to call a web service using ksoap2, I have been doing this successfully up till the point where I need to pass a more complex type to the web service.Does anybody have an example of passing a complex type to a webservice, preferably, only using SoapObject (the object in question is only Strings and dateTimes.

View 5 Replies View Related

Android :: More Complex Scrollview Example Needed

Nov 6, 2010

I am working on some sort of record lookup for a database. My code allows to search for some kind of string within an index (of that database) and returns the database-position of the found thing . With this found position my program is then able to move to adjacent records from the database moving forward and backwards from the initial position in small steps. ListView seems to not work in this case, as ListView starts per default at ListAdapter position 0 and not at an arbitrary position in the (here virtual) list. The api-docs doesn't seem to specify some sort of "start somewhere else and follow during scrolling". At least I haven't found that. So what I thought of is to use a ScrollView. Unfortunately I don't have a real understanding of how that could be realized with a huge number of records (and not just a handfull like in the examples). So, my questions are: - Is it possible to start a ListView at some defined position (without reimplementing {Abs}ListView) - Or can someone provide an example on how to implement a more complex ScrollView.

View 10 Replies View Related

Android :: Need To Have Complex ListView Adapter

May 18, 2009

I have ListActivity to show a custom list. The adapter for this list is a complex layout only known for each row at runtime depending on data gathered in a previous activity. The question I have is simple. I know it takes 4-6 seconds to prepare the adapter for the rows that will be visible (first 10), however I would like to let the user know by means of the empty list functionality or otherwise. At present the ListActivity is launched via a button on a previous activity and when that button is clicked the new activity will not be loaded until the adapter is completed, and the user is stuck with the previous activity until this happens. Code...

View 5 Replies View Related

Android :: Increase Hit Detection On ItemizedOverlay

Sep 23, 2010

I have an itemizedOverlay extended and I want to increase the hit detection on the OverLayItem's if this is possible?

View 1 Replies View Related

Android :: Runtime API Level Detection

Apr 27, 2009

I'm trying to product a binary that is compatible with 1.1 and 1.5, but i'm having trouble with the ViewSwitcher class behaving different. I'd like to create a wrapper for it, but I need a way to programatically detect the api level at runtime.

View 3 Replies View Related

Android :: Face Detection In Phone

Nov 8, 2010

I am currently working on an experimental camera app. I'm looking into implementing face detection at the moment and am currently weighing up my options.I have considered the OpenCV port available for android and using their face detection functions, but from demos I have seen of previous implementations the camera seems to lag a lot.Considering the camera on the HTC desire has face detecting, I know it must be possible to get at least a semi decent face detection system in place. I was just wondering if anyone had an opinion on how I could get the best results.Using an available library? Implementing a particular algorithm myself?

View 1 Replies View Related

Android :: Using Face Detection Program

Nov 5, 2010

Has anyone ever used the API for face detect in their android program?More simply stated, can I have a java class that pulls up the camera, scans a person's face and returns parameters back into the program?

View 1 Replies View Related

Android :: Pass Complex Objects Between Activities

Oct 18, 2009

I am trying to pass a user defined object to another activity Bundle bundle = new Bundle(); bund.putSerializable("myData", myData); intent.putExtra("bundle", bundle); where myData class implements Serializable interface. I am getting following error: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object how to pass complex objects between activities?

View 7 Replies View Related

Android :: ListView With Complex Data Model

Oct 20, 2009

I'd like to map an Array of "complex" data to a ListView. In a very simplified form my data model would look like something like this:
Code...

View 2 Replies View Related

Android :: Froyo - Killed Application Detection?

Jul 29, 2010

On Froyo, we found that some new "Task Manager" apps are now using the ActivityManager.killBackgroundProcesses() to kill apps. When this happens, Intent.ACTION_PACKAGE_RESTARTED is no longer fired. How can I find out that my application has been killed? I tried to start a service, and I do see this message printed in logcat:

W/ActivityManager( 2426): Scheduling restart of crashed service com.example.android.apis/.app.RemoteService in 20000ms

However, the service is never restarted as advertised, if the app is killed using the killBackgroundProcesses API. (If I go into adb shell and kill the service process, the service will indeed be restarted ...) This looks like a bug anyway, because the notification created by the app is no longer removed like in eclair (the StatusBarService, and a bunch of other system services, depend on the Intent.ACTION_PACKAGE_RESTARTED broadcast).

View 14 Replies View Related

Android :: Scrollview Doesn't Like A Complex Child

Apr 28, 2010

I've made a complex layout that has the following structure:

CODE:........

Since Scrollview only supports one child, I've created a RelativeLayout to scroll several Views. Unfortunately, this doesn't work (no scrolling). Are there limitations to the kind of children used in Scrollview or am I doing anything wrong?

View 9 Replies View Related

Android :: Handle Complex Objects From Webservice

Jul 30, 2009

How to handle a complex type object from webservice. Presently I am able to handle simple String messages. But if I am extracting some array of objects or String, then how to handle this.

View 4 Replies View Related

Android :: Enter Button With Finger Detection?

Apr 2, 2010

I'm working on a soundboard, however I've got a problem when it come to drag the finger over the screen to play the sounds for the buttons I drag the finger over.Do anyone know how I can detect when a finger enter a button and not click the button?

View 1 Replies View Related

Android :: How To Deal Complex Sql In Content Provider?

Feb 8, 2010

We want to add below update sql into our content provider:We found current update of content provider does not support it, which would not recognize the "column1" of "column1 + 1" as column name. So we have to add execSQL method into ContentProvider and I think it is dirt. So I wonder if anyone know how to do such thing with ContentProvider or any more elegant way to achieve it.

View 5 Replies View Related

Android :: Google Sky Map A Little Off / Orientation Detection Of Phone?

Jul 1, 2010

I've been trying out Google Sky Map and it seems a bit off. I hold my phone in landscape mode and point it at the moon as if I were going to take a picture of it. The application shows the moon about 5-10 degrees off from where it actually is. Is this just the accuracy of the compass and orientation detection of the phone?

View 9 Replies View Related

Android :: Pass Complex Objects With Help Of Intents?

Nov 18, 2010

I am trying to extend the "android.content.Intent" class by adding a private attribute of a custom class. My goal is to send complex objects from the main Activity to a background Service.
The extension itself is not a problem, the class gets compiled without any errors and the project runs. The only problem is that the BroadcastReceiver does not receive the modified Intent and the "onReceive" method gets never called.
It there any way to pass complex objects with the help of Intents?

View 1 Replies View Related







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