I have a Login view. When the user starts the app, if he already synced with the server before, the app opens on the login view and the user is prompted to enter his login. In this situation, the keyboard opens automatically when the app starts. If, however, the user never synced before, the user is redirected to the configuration view and will sync from there. After the sync is over, the configuration activity finishes and the user then sees the login view for the first time. At this moment, the focus is on the PIN edit text, as it should, but the keyboard does not open.
I tried several solutions found online, none of which worked. This is my code in its current state:
View:
#Override
public void onResume() {
super.onResume();
EditText pinEditText = (EditText)findViewById(R.id.passwordEditText);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
boolean dbContainsUsers = controller.Dispatcher.Count(new controller.User(), false) > 0;
if (!dbContainsUsers) {
Intent i = new Intent(getApplicationContext(), Configuration.class);
startActivity(i);
}
pinEditText.clearFocus();
pinEditText.requestFocus();
imm.showSoftInput(pinEditText, InputMethodManager.SHOW_IMPLICIT);
}
Layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="view.Login">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical">
<include layout="#layout/app_bar" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<EditText
android:id="#+id/passwordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/lgnEditTextMarginLeft"
android:textSize="#dimen/textSizeL"
android:ems="8"
android:inputType="numberPassword"
android:selectAllOnFocus="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="horizontal">
<Button
android:id="#+id/btnSynchroniser"
style="#style/RexforetTheme.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/btn_marge_top"
android:drawableLeft="#drawable/icon_sync"
android:textSize="#dimen/textSizeM"
android:text="#string/btn_synchroniser" />
<Button
android:id="#+id/btnConfiguration"
style="#style/RexforetTheme.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/btn_marge_top"
android:drawableLeft="#drawable/icon_configuration"
android:textSize="#dimen/textSizeM"
android:text="#string/btn_configuration" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.aaa.bbb">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/RexforetTheme">
<activity android:name="view.Login">
<intent-filter>
<action android:name="android.intent.action.MAIN"
android:windowSoftInputMode="stateVisible"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="view.MenuPrincipal" />
<activity android:name="view.Configuration" />
<service
android:name="service.WebDBService"
android:exported="false"/>
</application>
</manifest>
you have android:windowSoftInputMode="stateVisible" in this place replace
android:windowSoftInputMode="stateHidden|adjustPan"
in your menifest file
you have android:windowSoftInputMode="stateVisible" in this place replace
android:windowSoftInputMode="adjustResize"
in your manifest file.
Related
I am trying to create a login screen. I have used ScrollView to hold input fields. I have following xml:
<RelativeLayout ... >
<RelativeLayout
android:id="#+id/top_menu" ... >
<ImageButton ... />
<com.neopixl.pixlui.components.textview.TextView... />
</RelativeLayout>
<ScrollView
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/top_menu"
android:overScrollMode="always">
<LinearLayout
android:id="#+id/login_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<com.neopixl.pixlui.components.edittext.EditText
android:id="#+id/user_name_email"
android:layout_width="match_parent"
android:layout_height="#dimen/input_height_size"
android:layout_marginEnd="20dp"
android:layout_marginStart="20dp"
android:background="#drawable/edit_text_strock"
android:hint="#string/user_Name_Email_EditText"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:textColor="#color/White"
android:textColorHint="#color/White"
android:textSize="#dimen/register_input_text_size"
pixlui:typeface="MuseoSans.otf"/>
<com.neopixl.pixlui.components.edittext.EditText.... />
<com.neopixl.pixlui.components.button.Button... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.button.Button... />
</LinearLayout>
</ScrollView>
</RelativeLayout>
You can see full xml here.
When I click on EditText user_name_email, it goes off the screen.
Before click:
After click:
I have tried scrollTo(x, y) and smootScrollTo(x, y) bu they didn't work.
How can I fix it?
UPDATE:
adjustPan works but I want it to work with adjustResize.
Is it possible?
Use the following line in the manifest file, for the activity you need the change.
android:windowSoftInputMode="adjustPan"
Use it as shown below:
<activity
android:name=".ActivityName"
android:label="title_for_activity"
android:windowSoftInputMode="adjustPan" >
</activity>
Hope this helps.
add this to manifest file:
android:windowSoftInputMode="adjustPan"
in the targeted activity tag.
I have 2 classes, FirstActivity and SecondActivity.
First Activity
Intent intent=new Intent(getApplicationContext(),SecondActivity.class);
startActivity(intent);
Is it possible for SecondActivity to overlay on FirstActivity? ie. FirstActivity gets dimmed, SecondActivity gets displayed on top of FirstActivity.
If it is not possible for 2 different activities, is it possible to do an overlay for 2 views in the same activity? I hope using dialog is not the only option.
I suggest you set your second activity up as a dialog -- which will dim the background. Here is a tutorial that could be helpful:
http://developer.android.com/guide/topics/ui/dialogs.html
http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application
Or you can simply set the theme in the manifest as a dialog for your SecondActivity.
If you don't want to do a dialog, you can overlay views using a relative layout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout android:id="#+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="#+id/text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="some content"
android:textSize="70dp"/>
</LinearLayout>
<LinearLayout android:id="#+id/overlay"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#99000000"
android:clickable="true"
android:visibility="gone">
<EditText android:id="#+id/edittext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="50dp" />
</LinearLayout>
</RelativeLayout>
The first LinearLayout (id/content) is your base layout where your normal content would go.
The second LinearLayout (id/overlay) is your overlay layout which you'd want to show over top of the base layout. The background color will give give you that faded out background, and you can add whatever you want to that layout to make your overlay. To show the overlay, just change its visibility from gone to visible.
In manifest file declare the secondactivity activity like this. android:theme="#android:style/Theme.Dialog".then simply call the secondactivity from firstactivity from your code.
<activity
android:name=".FirstActivity"
android:label="#string/title_activity_first" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SecondActivity"
android:label="#string/title_activity_second"
android:theme="#android:style/Theme.Dialog"
>
<intent-filter>
<action android:name="transparent.text.SECONDACTIVITY"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Second Activity xml file.you can design as your wish but for reference i have posted this.the key concept is in manifestfile (ie) how to define your secondactivity in manifest
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="192dp"
android:background="#aabbcc"
android:text="Sybrant has provided Takoma with a great team which helped us from the beginning to the final stage of our product, to our fullest satisfaction. We have been able to deliver a high quality of eLearning products to our corporate customers like Nissan with Sybrant’s support”"
tools:context=".FirstActivity" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="43dp"
android:layout_marginLeft="80dp"
android:text="Button" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/button1"
android:layout_below="#+id/textView1"
android:layout_marginRight="42dp"
android:layout_marginTop="80dp"
android:text="TextView" />
</RelativeLayout>
1-Take a screenshot of the first activity.
2-(Optional) Darken, tint or blur the screenshot.
3-Then call the second activity and use the first activity screenshot as background for the second activity.
This is the error message I keep getting when I run my app in the emulator.
There's nothing in the Error Log and it doesn't really tell me where the error is coming from but I get this in the LogCat:
WARN/ActivityManager(51): Launch timeout has expired, giving up wake lock!
WARN/ActivityManager(51): Activity idle timeout for HistoryRecord{44e0fb68 com.gamer.network2/.FirstActivity}
WARN/InputManagerService(51): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#44e98158
ERROR/gralloc(51): [unregister] handle 0x494d08 still locked (state=40000001)
This is my Java for the Layout that comes up when the app is started: (I would think if this is what comes up first, that would be where the problem is, but I really don't know.)
package com.gamer.network2;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class FirstActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView next1 = (TextView) findViewById(R.id.signuptext);
next1.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), Screen2.class);
startActivityForResult(myIntent, 0);
finish();
}
});
}
}
Here's my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gamer.network2"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application android:icon="#drawable/newlogo2"
android:label="#string/app_name">
<activity android:name=".FirstActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Screen2"></activity>
<activity android:name=".Screen3"></activity>
<activity android:name=".Screen4"></activity>
<activity android:name=".MyOnItemSelectedListener"></activity>
</application>
</manifest>
And the XML code for the layout/main:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/background"
android:weightSum="1"
>
<ImageView android:src="#drawable/newlogo2"
android:id="#+id/imageView1"
android:layout_gravity="center"
android:layout_marginTop="30dip"
android:layout_height="112dp"
android:layout_weight="0.11"
android:layout_width="135dp"></ImageView>
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="#+id/textView2"
android:text="Sign in to GameNet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dip"></TextView>
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="#+id/textView3"
android:text="Username:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dip"
android:layout_marginTop="15dip"></TextView>
<EditText android:id="#+id/EnterUsername"
android:layout_height="wrap_content"
android:layout_width="190dp"
android:layout_gravity="center">
<requestFocus></requestFocus>
</EditText>
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="#+id/textView4"
android:text="Password: "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dip"
android:layout_marginTop="10dip"></TextView>
<EditText
android:id="#+id/EnterPassword"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_gravity="center"
android:layout_width="190dp"></EditText>
<Button android:text="Sign in"
android:id="#+id/button1"
android:layout_width="121dp"
android:layout_gravity="center"
android:layout_height="wrap_content"></Button>
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="#+id/signuptext"
android:text="Not a member? Sign up now!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dip"></TextView>
</LinearLayout>
I can post whatever other code you need to help me. =]
Thanks
i think onClickListener is for buttons only, not textviews
I'm trying to turn a single page app into one with tabs. I've looked at various Googled solutions, but none work, and I can't find a 'Tabs - how they work' anywhere! One problem I have when using a 'Googled' answer is a null pointer exception on the Layout of main.xml.
Can anyone help/point me to a decent page?
My code is below.
Thanks,
Martin.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="#+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/edtICAO" android:text=" "></EditText>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Brief!" android:id="#+id/btnBrief" android:onClick="btnBriefClick"></Button>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/btnHome" android:text="Home" android:clickable="true" android:onClick="btnHomeClick"></Button><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/btnChartList" android:text="Charts List" android:onClick="btnChartClick"></Button></LinearLayout><ScrollView android:id="#+id/ScrollView02" android:layout_width="wrap_content" android:layout_height="wrap_content"><LinearLayout android:id="#+id/LinearLayout02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Metar :" android:id="#+id/txtMetar"></TextView><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TAF :" android:id="#+id/txtTAF"></TextView></LinearLayout></ScrollView><ScrollView android:id="#+id/ScrollView01" android:layout_width="fill_parent" android:fillViewport="true" android:isScrollContainer="false" android:scrollbarAlwaysDrawHorizontalTrack="true" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbars="horizontal|vertical" android:visibility="visible" android:layout_height="fill_parent">
<TextView android:id="#+id/txtNotam" android:text="NOTAM :" android:layout_height="fill_parent" android:layout_width="fill_parent" android:textColor="#color/black" android:background="#color/white"></TextView>
</ScrollView>
</LinearLayout>
Hey martin,
make sure you follow this guide:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
The tutorial is not complete, however. After completing all the steps, open you AndroidManifest.xml file and add the following:
<activity android:name=".TabName"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
for every tab (insert appropriate class name instead of TabName). I'm assuming that you will create a separate class for each tab, just like in the tutorial.
Yes, I had looked at that, but thought it was a bit complex. Having now done the project I realise that's the way it is!!
However, the project will compile and install, but won't run.
On a real phone 'Open' is disabled after installation and the app doesn't appear in the apps list.
On the emulator, :
[2010-11-12 11:49:49 - HelloTabWidget] The launch will only sync the application package on the device!
[2010-11-12 11:55:46 - HelloTabWidget] Success!
[2010-11-12 11:55:46 - HelloTabWidget] \HelloTabWidget\bin\HelloTabWidget.apk installed on device
[2010-11-12 11:55:46 - HelloTabWidget] Done!
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="martin.HelloTabWidget"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"></activity>
<activity android:name=".ArtistsActivity" android:label="ArtistsActivity"> </activity>
<activity android:name=".AlbumsActivity" android:label="AlbumsActivity"></activity>
<activity android:name=".SongsActivity" android:label="SongsActivity"></activity>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
In my previous question I asked if System.currentTimeMillis() was buggy in Droid, and the answer was no.
I assume the problem I'm having is somewhere else. While I wait for my Droid lone-user to report if a test app works on his phone, I would like to post some relevant code here.
Please keep in mind that I removed everything in the code I thought would be irrelevant (posting the code leading to the first suspicious line in the log). I might have removed the code where the problem is, but I doubt it. It smells like a layout, not code, problem. I say this because (see last line, where the log is) the surface is 0.
Best regards, Ari.
MANIFEST
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".BeMeBB" android:label="#string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="BeMeBBPref" android:label="#string/app_name">
</activity>
</application>
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
<supports-screens>
</supports-screens>
LAYOUT
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="0pt" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:gravity="bottom" android:background="#00000001">
<android.view.SurfaceView android:id="#+id/preview_LAND"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:keepScreenOn="true" android:layout_margin="0pt">
</android.view.SurfaceView>
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:id="#+id/ACCELERATION_LINE" android:text="0 2 4 6 8 10 12 14 16 18 20 "
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:typeface="monospace" android:layout_weight="0"
android:textSize="20dp" android:textStyle="bold" android:textColor="#color/white"
android:layout_gravity="center_horizontal" android:paddingTop="0dp"
android:paddingLeft="0dp" android:background="#66000000" />
<TextView android:id="#+id/ACCELERATION" android:text="#string/Accelerometers"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:typeface="monospace" android:textStyle="bold"
android:layout_weight="0" android:textSize="20dp" android:textColor="#color/white"
android:layout_gravity="center_horizontal|top" android:paddingLeft="0dp"
android:background="#66000000" />
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:gravity="bottom" android:layout_weight="1">
<Button android:id="#+id/SAVE_LAND" android:text="#string/Save"
android:layout_width="wrap_content" android:gravity="left|bottom"
android:layout_height="wrap_content" android:layout_weight="0"
android:textSize="26dp" android:textColor="#color/black"
android:padding="20dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
CODE
public class BeMeBB extends Activity implements OnClickListener, android.content.DialogInterface.OnClickListener, SensorEventListener {
private SurfaceView preview=null;
private SurfaceHolder previewHolder=null;
SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {
public void surfaceCreated(SurfaceHolder holder) {
DoRecording();
}
}; // End SurfaceHolder.Callback surfaceCallback
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main_land);
preview=(SurfaceView)findViewById(R.id.preview_LAND);
previewHolder=preview.getHolder();
previewHolder.addCallback(surfaceCallback);
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} // End OnCreate
private void DoRecording() {
m_worker.setSurfaceHolder(previewHolder);
} // End DoRecording
} // End class
IN ANOTHER CLASS
public void setSurfaceHolder(SurfaceHolder previewHolder) {
m_previewHolder = previewHolder;
m_surface = m_previewHolder.getSurface();
Log.d("BeMeBB", "BeMeBBWorker m_surface=" + m_surface);
} //End setSurfaceHolder
AND THE RESULT IN LOG (SURFACE IS NOT VALID):
11-19 17:58:13.171 D/BeMeBB ( 1404): BeMeBBService m_surface=Surface(native-token=0)
Now it's confirmed, my lone Droid user sent back the 2 log files from:
A test app using MediaRecorder.setPreviewDisplay (Surface sv). It REQUIRES use of getSurface, which crashes in API 5 on Droid phone.
A test app using Camera.setPreviewDisplay(SurfaceHolder sh). It REQUIRES use of MediaRecorder.setCamera for preview, but setCamera is apparently broken "Known limitation - locked camera" in API 3.
So: I Cannot have a previewed media recorder that works on 1.5 and 2.0. So my only option is, (confirmed MediaRecorder.setCamera is not broken in Android2.0 - they added an unlock) is to have two separate versions , one for API 3 and one for API 5.
Thank you commonsware for pointing me in the right direction. I will change the status to "answered" once I try again with deviceanywhere, just to be safe.