stupid camera.startPreview question

by enervatron » Wed, 27 May 2009 04:19:05 GMT


Sponsored Links
 Hi all,

I'm using the camera for which I've used the CameraPreview example.
All is working just fine --
I'm getting pictures, etc, but when I spin up the SurfaceView  and
startPreview on it (directly
from the example code) the screen is just blank.

Question: shouldn't I be seeing a preview of the view field when I'm
in this mode just like
the system camera app? If so, why would the surfaceview be black/blank?

Mike

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



stupid camera.startPreview question

by Max Salley » Wed, 27 May 2009 04:56:19 GMT


 Whatever SurfaceHolder you gave the camera needs to have its type set
to SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS.  This may not be your
problem, but it will cause a blank screen



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


Sponsored Links


stupid camera.startPreview question

by enervatron » Wed, 27 May 2009 05:32:45 GMT


 yes, the sample code does this, and hence my code is doing it as well.

Mike





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



Other Threads

1. Setting new default ringtone without using RingtonePicker?

I'd like to programmatically set a new default ringtone without using
RingtonePicker. In other words, there is a certain ringtone that is
already installed on my system, and I want to programmatically set it
to be my default ringtone without any human interaction.

The reason I want this is because every time I reboot my N-1, my
previous default ringtone setting gets forgotten, and I am given
another ringtone that I don't like. I want to set up an app that I can
run manually (or even better, to cause to automatically run upon
startup), and which will reset my default ringtone to the one that I
like without my having to manually do this via the Settings.

The only examples I have found so far for doing this involve using
RingtonePicker, but as far as I can tell, this requires human
interaction, which I want to avoid.

Thanks in advance for your suggestions and pointers.

-- 

2. Launch Activity from BroadcastReciever

Hey. I have a BroadcastReceiver, which works well, however, I want to
show a full UI when it is hit. At the moment, I can create a Toast,
which appears, but I can't seem to make a UI appear (I'd rather not
make one programmatically). So, unable to set a content, I tried to
use Intent to change to an activity, which has content set up.
Only, it doesn't appear to work. Any help would be most appreciated.
Source code (ignoring imports) below:

Reciever.java

public class Reciever extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        Toast.makeText(context, "Alarm Recieved",
Toast.LENGTH_LONG).show();
        Intent i = new Intent();
        i.setClass(context, AlarmRing.class);
    }
}


AlarmRing.java

public class AlarmRing extends Activity {

        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.alarm);

        MediaPlayer mp = MediaPlayer.create(getBaseContext(),
R.raw.sweetchild);
        mp.start();
    }
}


Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.comaad.andyroidalarm"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".AndyRoidAlarm"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                   <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name=".Reciever" android:enabled="true">
                        <intent-filter>
                                <action 
android:name="com.comaad.andyroidalarm.OneShotAlarm"></
action>
                        </intent-filter>
                </receiver>
        <activity android:name=".AlarmRing"></activity>
    </application>
</manifest>

-- 

3. Maths behind the Android orientation calculation algorithm

4. stuck in OnTouchEvent & OnClikc method. please help

5. Full-screen virtual keyboard?

6. The best way to pick file

7. Best Practices