Android :: Need To Calculate Rotation Vector

May 18, 2010

I need to calculate a rotation vector out of the data i get from Sensor.TYPE_ORIENTATION. The sensor data is defined like this: the values have to be recalculated to become a correct 3d position: values[0]: Azimuth, angle between the magnetic north direction and the Y axis, around the Z axis (0 to 359). 0=North, 90=East, 180=South, 270=West values[1]: Pitch, rotation around X axis (-180 to 180), with positive values when the z-axis moves toward the y-axis. values[2]: Roll, rotation around Y axis (-90 to 90), with positive values when the x-axis moves away from the z-axis need all three values like the Z axis value (from 0 to 360 degree). I tried a lot but cant figure out how to do this :/ So i bet there is a simple solution how to recall the values of sensor.TYPE_ORIENTATION to make them a 3d rotation vector, but i just dont know how to do it. If you know the answer please tell me. Code...

Android :: Need to calculate rotation vector


Android :: Use An OpenCV Rotation And Translation Vector With OpenGL ES In Droid?

Sep 14, 2010

I'm am working on a basic augmented reality application on Android. What I did so far is detect a square with opencv and then using cvFindExtrinsicCameraParams2() I calculated a rotation and translation vector. For this I used 4 object points, which are just the corners of a square around (0,0,0) and the 4 corners of the square in the image.

This yields me a pretty good rotation and translation matrix. I also calculated the rotation matrix with cvRodrigues2() since using this is easier than the rotation vector. As long as I use these to draw some points in the image everything works fine. My next step is however to pass these vectors and the matrix back to java and then use them with OpenGL to draw a square in an OpenGLView. The square should be exactly around the square in the image which is displayed behind the OpenGLView.

My problem is that I cannot find the correct way of using the rotation matrix and translation vector in OpenGL. I started of with exactly the same object points as used for the openCV functions. Then I applied the rotation matrix and translation vector in pretty much any possible way I could think of. Sadly none of these approaches produce a result which is anyway near what I hoped for. So my question is can anyone tell me how to use them correctly?

So far the "closest" results I have gotten, was when randomly multiplying the whole matrix with -1. But most of the time the squares still look mirror inverted or rotated for 180 degrees. So I guess it was just a lucky hit, but not the right approach.

View 1 Replies View Related

Android :: Put A Vector Into My Arrayadapter?

Sep 3, 2010

I have the current code...

How would i put a vector into my array_spinner?

View 1 Replies View Related

Android :: Scalable Vector Graphics

Jun 26, 2009

Does the current API support scalable vector graphics? If so which file formats? If not, will it be added in the future? I ask because I'd like my animations to based off of SVGs - in order to better support different screen resolutions while reducing file size.

View 2 Replies View Related

Android :: How To Put Vector Into Intent.extra?

Aug 20, 2010

I've started to write a small app for android. It looks very nice, but there is one thing I don't understand.I've created a new intent in the activity A and I've added a serialized vector intent.putExtra("key", vector).

View 3 Replies View Related

Android :: Call Intent And Put Into Vector?

Aug 25, 2010

b = this.getIntent().getExtras();
s = this.getIntent().getStringExtra("DEFAULTTEXT");

public void onClick(View v)
{
String a = "http://152.226.152.156:1010/jsp-examples/test1";
URL url = null;
HttpURLConnection httpurlconnection = null;
try {
url = new URL(a);
httpurlconnection = (HttpURLConnection) url
.openConnection();
httpurlconnection.setDoOutput(true);
httpurlconnection.setRequestMethod("POST");
Toast.makeText(Booking.this, a, Toast.LENGTH_SHORT).show();
Toast.makeText(Booking.this, "Toast1", Toast.LENGTH_SHORT).show();
ObjectOutputStream dos = new ObjectOutputStream(httpurlconnection.getOutputStream());
SendVEctor.add(txtArrivalTime.getText().toString());
SendVEctor.add(txtFerry.getText().toString());
SendVEctor.add(txtStatus.getText().toString());
SendVEctor.add(txtDestination.getText().toString());
SendVEctor.add(s.toString());
dos.writeObject(SendVEctor);
dos.close();

s would be my intent and how would i put it into my SendVEctor?

View 2 Replies View Related

Android :: How To Load Dynamic Array From Vector?

Feb 1, 2010

how to load dynamic array from vector in android?

View 1 Replies View Related

Android : How To Display Contents Of A Vector In Phone?

Sep 7, 2010

how to display the contents of a vector in android?do i need to use TextView?

View 2 Replies View Related

Android :: Need To Store _ Retrieve Vector In Sqlite Database

Sep 1, 2010

I need to store an retrieve a vector of an unknown number of objects in an android sqlite database. Essentially, the setup is this: I am developing a task management app, where the user can add as many notes as they like to their tasks. My current setup uses one database, with one row per task. This presents a problem when I need to associate multiple notes and their associated information with one task. I can see two approaches: try to store an array of notes or a vector or something as a BLOB in the task's row, or have another notes database in which each row contains a note and it's info, as well the id of the task which the note belongs to. This seems a little easier to implement, as all I would have to do to retrieve the data would be to get a cursor of all notes matching a particular id and then iterate through that to display them to the user. However, it seems a little inefficient to have a whole new database just for notes, and it makes syncing and deleting notes a little more difficult as well. What do you think? Is it worth it to have a separate notes database? Should I use a BLOB or go for the separate database? If a BLOB, are there any good tutorials out there for storing and retrieving objects as BLOBs?

View 2 Replies View Related

Android :: Way To Store / Display Vector Text In Phone Without Flash?

Aug 12, 2010

What vector graphic formats can be used to display the in a view in an android application? As I understand, PDF is not an option at the moment, so what other options are there for storage and display of complex text+graphics? Unfortunately, I cannot use embedded browser with Flash because I need this app to work on Android versions before 2.2.

View 1 Replies View Related

Android :: Android - Offline - Non Vector Based - Custom Maps

Sep 26, 2009

For an application I am working on, I need to display custom raster image tiles (not vector based, probably from satellite imagery), and I need to do so offline. I would like to use the MapView, but I cannot see a way to tell it to use custom, offline map tiles instead of pulling down data from google's servers.

I've seen a few alternatives, but none seem appropriate to my need MapDroyd Seems to only support vector-based maps. mapdroyd.com/ OSMDroid Appears to use Open Street Maps; I don't see any documentation anywhere stating that you can use custom map tiles. code.google.com/p/osmdroid/ There was a third alternative, but my post got eaten and I can't find it in my history. Am I going to have to bite the bullet and 'roll my own'?

View 4 Replies View Related

Android :: How To Calculate Beats Per Minute?

Sep 25, 2010

I would like to record from the device microphone and then be able to calculate the beats per second of the recorded audio, is it possible and how? is there any open source project I can look?

View 1 Replies View Related

Android :: Calculate CPUTime Per Process

Nov 16, 2010

I want to calculate CPUTime per process for Android devices.

View 3 Replies View Related

Android :: Calculate Space Does A TextView Take?

Jul 21, 2010

How much space does a TextView take?

When I declare a TextView, is it possible to calculate how much space (height and width) it is going to take when actually rendered on the phone?

I have noticed that based on the different screen sizes of phones (or density), the TextView is rendered accordingly. I want to be able to calculate the exact height and width rendered.

View 1 Replies View Related

Android : Can I Calculate Daily Calories V1.0

Jan 3, 2010

Calculate with 4 easy steps the daily calories you need. The application is in English, Spanish, French and Italian.

Calculate daily calories v1.0 Application for Android | Health AND IT'S FREE

View 2 Replies View Related

Android : Want To Calculate Most Used Apps-droid

Jan 9, 2010

So I'm developing an app for android, and before I get too much into it, I want to conceptually get my arms around what I am trying to do. Is it very difficult to calculate or track the most frequently accessed apps? Any ideas or insights about how I might go about getting this done would be greatly appreciated! I'm used to iphone development, and am quite new to the android platform.

View 2 Replies View Related

Android : Need To Calculate Date Difference

Aug 13, 2010

How to calculate the date difference in Android?

View 1 Replies View Related

Android : Calculate An Appropriate Field Width?

Sep 18, 2010

In my app I am displaying a table where the individual cells are editable text fields (i.e. EditText objects). I am currently struggling calculating appropriate widths for these.

If I set the width to be as many "Ems" as the displayed text has characters, my fields are much to wide by about a factor of 2 and the table looks ugly and wastes lots of precious screen space. Setting the width in "Ems" is essentially like assuming the worst case, i.e. the width of a string under the assumption that it contains only the broadest characters in a font, usually 'M' (hence the name of the method), 'm', 'W', or '_'). But on average strings contain narrower characters and so most of these fields are half empty and much too wide for their actual content. I am thus desperately seeking a way to calculate a better fitting width, not that worst case width.

The "normal" way to do this in Java (in AWT or Swing at least) is to asks a widget's current Font (actually a Font's FontMetrics), to calculate and return the width that will be necessary to display a given string in pixels. But how does one obtain a TextView's Font? I haven't found any method to obtain a (Text)View's font and/or calculate a more appropriate width given the actual content of a cell's text string. How does one do that in Android?

View 1 Replies View Related

Android : Way To Calculate SpannableString Witdh

Nov 22, 2010

I'm building a text at runtime that will be put into a TextView. This text has composed with different size fonts. I must calculate the width in pixels of this text. I have tried to use Paint.measureText, but it does not consider the different font sizes.
How can I calculate the real width?

this is an example: code..

In this example, if I set the relative size to "2f " or "3f"(for example), the total size that returns "MeasureText" is the same.

View 1 Replies View Related

Android :: Can Calculate Current Altitude - Placed Mouse On Map

Dec 23, 2008

Need a app that can do that... google earth for the pc gave good elevation based on where u placed your mouse on the map.... the map function unfortunately doesn't or if so... don't know how to access it

View 4 Replies View Related

Android :: Calculate Distance Using Latitude And Longitude

Aug 9, 2009

I want to know that how can i calculate distance between two point using their latitude and longitude in android ?

View 4 Replies View Related

Android :: Calculate Distance Between To City - Dynamically

Sep 16, 2010

I want to calculate the distance between 2 city, whatever user mention.

Example - Default City - 1st City - New York or New Delhi, London Seoul anything User Put - 2nd City - California

Need - to calculate distance between California to New York or London

View 9 Replies View Related

Android :: Calculate Distance Between Two GeoPoints With MapView

Jun 20, 2010

I want to know the distance of two points or the width and height distance of my current mapview in km unit. Is there any android map api to do that?

View 1 Replies View Related

Android :: Using Accelerometer To Calculate Distance - Eleveation

Jun 28, 2010

Can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ? using android's accelerometer or is there any other way to calculate such in android ?

View 2 Replies View Related

Android :: Need Calculate Distance / Travel Time App

Dec 23, 2009

Is there Android application that can be used to calculate travel time and distance?

View 2 Replies View Related

Android :: How Does AdMob Calculate How Much To Pay Developers Per Click?

Aug 14, 2010

I just integrated AdMob into my app. I noticed that in South Korea, there were 24 clicks, but that I only got 7 cents off of those clicks. In Malaysia, there was one click that generated 11 cents, and in Japan there were 2 clicks that generated 0 cents Does anyone know how this works? Also, does AdMob or Google AdSense generate more money?

View 3 Replies View Related

Android :: How To Calculate Speed With Which Mobile Is Moving?

Jun 9, 2010

How to calculate the speed with which android mobile is moving, i.e user with mobile in his pocket/hand. Basically I would like to invoke some activity based on the user's speed, how will I calculate? based on what parameters in mobile.

View 2 Replies View Related

Android :: Calculate Days Since A Record Entry?

Aug 4, 2010

I have a database with a field for a stored date. I would like to be able calculate the days between the recorded date and today.

I ended up using:

mDb.execSQL("UPDATE "+DATABASE_PLANTS_TABLE+" SET "+ KEY_PLANT_DAYS+
" = (SELECT julianday('now') - julianday("+KEY_DATE+") FROM"+ DATABASE_PLANTS_TABLE+")");

View 2 Replies View Related

Android :: Calculate Hash Value Of All Folders In Phone?

Jul 7, 2010

I want to calculate the hash value of the all the folders in a particular directory. I am able to do it in a java application.

Any idea how to do it in Android?

View 2 Replies View Related

Android :: Calculate Text Lenght Without Actually Printing It?

Dec 7, 2009

Given a style (font, size, bold/italic, etc), is there a way to calculate how many (horizontal) pixels a text will take when printed on a Canvas, without actually printing it?

View 2 Replies View Related







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