Can I use UNIQUE in the query() parameter?

by Ralf » Mon, 13 Apr 2009 13:36:24 GMT


Sponsored Links
 What Mark said, you probably meant DISTINCT.

For reference, the Sqlite3 doc on SELECT is here:
   http://www.sqlite.org/lang_select.html 

Also remember that you have the sqlite3 binary either in SDK/tools or
via adb shell. It can be handy to simulate your select manually once
before you code your query.

R/





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Animating an Updating TextView

Animated TextView Not Updating..

Ok. Here is my problem.. I am a little new to android dev.. I'm having
a hard time understanding 2D graphics..

I was able to make my Layout rotated like iPhone's LandscapeLeft to
LandscapeRight.. It has a TextView that updated with accelerometer
values...
The problem is that after the animation the TextView stops updating..

I have read that this type of animation only moves the view.. and that
everything else is still in it's previous position... Can someone help
me understand. I have attached my project in case somebody wanted to
look at it..

ANY suggestions would be much appreciated.. Thanks..

The project is also in Github 
https://github.com/miscventura/AnimatingUpdatingTextView

Here is the code..

package org.example.hello;

import android.app.Activity;
.......
import android.widget.TextView;


public class Hello extends Activity implements SensorEventListener {
/** Called when the activity is first created. */

Camera camera;
SurfaceView surfaceView;
SurfaceHolder surfaceHolder;
boolean previewing = false;
LayoutInflater controlInflater = null;

TextView numbersView;
TextView numbersView2;

// for orientation change
OrientationEventListener mOrientationEventListener;
int mDeviceOrientation;
public SensorManager sensorManager = null;
float accelerationX;
float accelerationY;

// ///Orientation//////
static final int lanscapeLeft = 2;
static final int lanscapeRight = 1;
int orientation = 2;

View viewControl;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// *******************************************
// full screen mode
// *******************************************
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FL AG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// *******************************************
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);

//sets a floating layer
viewControl = getLayoutInflater().inflate(R.layout.mainview, null);
setContentView(viewControl);

numbersView = (TextView) findViewById(R.id.numbersview);
numbersView2 = (TextView) findViewById(R.id.numbersview2);



mOrientationEventListener = new OrientationEventListener(this,
SensorManager.SENSOR_DELAY_NORMAL) {
@Override
public void onOrientationChanged(int orientation) {
mDeviceOrientation = orientation;
}
};

if (mOrientationEventListener.canDetectOrientation()) {
mOrientationEventListener.enable();
}
}

// 
///////////////////////////////////////////////////////////////////////////////////
// /////////////////////////ACCELEROMETER SET
// UP/////////////////////////////////////
// 
/////////////////////////////////////////////////////////////////////////////////
@Override
protected void onResume() {
super.onResume();
// Register this class as a listener for the accelerometer sensor
sensorManager.registerListener(this,
sensorManager.getDefaultSensor(Sensor.TYPE_ACCELER OMETER),
SensorManager.SENSOR_DELAY_GAME);

}

public void onAccuracyChanged(Sensor arg0, int arg1) {
// TODO Auto-generated method stub

}

public void onSensorChanged(SensorEvent event) {
// TODO Auto-generated method stub
synchronized (this) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {

// high-pass filter to eliminate gravity
accelerationX = event.values[0];
accelerationY = event.values[1];
String accValue = String.format("%.1f", accelerationX);
String accValue2 = String.format("%.1f", accelerationY);

if (mDeviceOrientation <= 300 && mDeviceOrientation >= 240) {
animateRootViewToLanscapeLeft(viewControl);
}
if (mDeviceOrientation >= 60 && mDeviceOrientation <= 120) {
animateRootViewToLanscapeRight(viewControl);
}


numbersView.setText(accValue);

numbersView2.setText(accValue2);
}
}
}

public void animateRootViewToLanscapeLeft(View view) {
if (orientation == lanscapeRight) {
Animation spin = AnimationUtils.loadAnimation(
getApplicationContext(), R.anim.tolandscapeleft);
view.setAnimation(spin);
spin.setFillAfter(true);
spin.start();
orientation = lanscapeLeft;
}
}

public void animateRootViewToLanscapeRight(View view) {
if (orientation == lanscapeLeft) {
Animation spin = AnimationUtils.loadAnimation(
getApplicationContext(), R.anim.tolandscaperight);
view.setAnimation(spin);
spin.setFillAfter(true);
spin.start();
orientation = lanscapeRight;
}
}


}

-- 

2. StackView example as a non-widget application

I see that there is sample code in the Android SDK for using StackView
as a widget here:

http://developer.android.com/resources/samples/StackWidget/index.html

Does anyone know of any samples for using StackView in a non-widget
application (i.e. inside an Activity and populating it with drawables
instead of from Remote resources)?

Thank you very much,
-Kelly

-- 

3. Internet not working via adhoc network connection in galaxy ace GT-S5830

4. Removing a specific over lay item

5. How to connect to Internet with Wifi when no Cellular Service is present

6. C2DM server

7. Any good answer to: No subject alternative DNS name matching android.apis.google.com found