Monday, April 22, 2013

[android help] Is it possible to bind textview value dynamically within dialog header : Android?


Hi i need to bind a value with in dialog header dynamically and even toggle button click events the value want to be changed in textview.. i've got the null pointer exception error.. plz help me to find wat i did wrong ??



dialog = new Dialog(context1);
window = dialog.getWindow();
dialog.requestWindowFeature(dialog.getWindow().FEATURE_CUSTOM_TITLE);
window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.lv_train_header);

bindTrainTimings(Area_Index1, Area_Index);
bindTrainTimings(Area_Index, Area_Index1);
tvStart = (TextView) dialog.findViewById(R.id.idTvStart);
tvEnd = (TextView) dialog.findViewById(R.id.idTvEnd);
tg = (ToggleButton) dialog.findViewById(R.id.tglBtn);
dialog.getWindow().getAttributes().windowAnimations = R.style.Animations_SmileWindow;
Log.d("listData111111", "listData.toString()");
tvStart.setText("hello");
tvEnd.setText("hai");

tg.setOnClickListener(new OnClickListener() {

public void onClick(View v) { // TODO Auto-generated method stub //
Log.d("tg.setOnClickListener", "tg.setOnClickListener"); //
Log.d("Toggle loading2", listData1.toString()); if (tg.isChecked()) {

if (Area_Index < Area_Index1) {
customAdapter = new MyCustomAdapter2( Train_Origin_Destination.this,
listData1); } else if (Area_Index > Area_Index1) {

customAdapter = new MyCustomAdapter2( Train_Origin_Destination.this,
listData); } lvTrainTime1.setAdapter(customAdapter);

} else {

if (Area_Index < Area_Index1) {

customAdapter = new MyCustomAdapter2( Train_Origin_Destination.this,
listData); } else if (Area_Index > Area_Index1) {

customAdapter = new MyCustomAdapter2( Train_Origin_Destination.this,
listData1); } lvTrainTime1.setAdapter(customAdapter);

} } });

dialog.show();


LogCat Error :



04-23 11:04:55.753: E/AndroidRuntime(846): FATAL EXCEPTION: main
04-23 11:04:55.753: E/AndroidRuntime(846): java.lang.NullPointerException
04-23 11:04:55.753: E/AndroidRuntime(846): at com.example.train.Train_Origin_Destination.onClick(Train_Origin_Destination.java:570)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.view.View.performClick(View.java:4084)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.view.View$PerformClick.run(View.java:16966)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.os.Handler.handleCallback(Handler.java:615)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.os.Handler.dispatchMessage(Handler.java:92)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.os.Looper.loop(Looper.java:137)
04-23 11:04:55.753: E/AndroidRuntime(846): at android.app.ActivityThread.main(ActivityThread.java:4745)
04-23 11:04:55.753: E/AndroidRuntime(846): at java.lang.reflect.Method.invokeNative(Native Method)
04-23 11:04:55.753: E/AndroidRuntime(846): at java.lang.reflect.Method.invoke(Method.java:511)
04-23 11:04:55.753: E/AndroidRuntime(846): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-23 11:04:55.753: E/AndroidRuntime(846): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-23 11:04:55.753: E/AndroidRuntime(846): at dalvik.system.NativeStart.main(Native Method)


.

stackoverflow.comm

[android help] Android removing TitleBar for Activity causes ClassCastException. Why?

Android removing TitleBar for Activity causes ClassCastException. Why? - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















I'm getting a ClassCastException on the following line:



content = ((LinearLayout) findViewById(android.R.id.content).getParent());


This is only when I set the theme of the Activity/App as android:Theme.NoTitleBar


Same problem with Fullscreen also.



FATAL EXCEPTION: main
E/AndroidRuntime(648): java.lang.ClassCastException: com.android.internal.policy.impl.PhoneWindow$DecorView


















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default






.

stackoverflow.comm

[android help] How to listen for soft keys in android?


I want to know how we can listen for the soft keys in android. In the above figure i want to listen for down arrow( i have marked it in red colour, the key one which is used to hide the keyboard). I have tried to get it action through menu options, viewconfiguration class etc. But it is not useful. Is there any method, listeners or any callback event to track this button. Please let me know your suggestions and thoughts. Any help in this regard is highly appreciable



.

stackoverflow.comm

[General] Video recording time limit


I get a video recording time limit on my LG G2X. It stops at 10 minutes no matter what video app I use. I have 30 gigs of SD space so that is not the issue.

Anyone know how to get around this limit?



.

forum.xda-developers.com

[android help] Slow glTexSubImage2D performance on Nexus 10/Android 4.2.2 (Samsung Exynos 5 w/ Mali-T604)


I have an Android app that decodes video into yuv420p format then renders video frames using OpenGLES. I use glTexSubImage2D() to upload y/u/v buffer to GPU then do a YUV2RGB conversion using shader. All EGL/OpenGL setup/rendering code is native code.


Now I am not saying there is no problem with my code, but considering the same code is running perfecting fine on iOS (iPad/iPhone), Nexus 7, Kindle HD 8.9, Samsung Note 1 and a few other cheap chinese tablets (A31/RockChip 3188) running Android 4.0/4.1/4.2. I would say it's less likely my code is wrong. On those devices, glTexSubImage2D() uses less than 16ms to upload a SD or 720P HD texture.


However, on Nexus 10, glTexSubImage2D() it takes about 50~90ms for a SD or 720P HD texture which is way too slow for a 30fps or 60fps video.


I would like to know


1) if I should pick a different texture format (RGBA or BGRA). Is there a ways to detect which is the best texture format used by a GPU?


2) if there is a feature that is 'OFF' on all other SOCs but set to 'ON' on Exynos 5. For example, the automatic MIPMAP generation option. (I have it off, btw)


3) if this is a known issue of Samsung Exynos SOC - I can't find a support forum for Exynos CPU


4) Is there any option I need to set when configure the EGL surface? like, transparency, surface format, etc? (I have no idea what I am talking about)


5) It could mean GPU is doing an implicit format conversion but I checked GL_LUMINANCE is always used. Again it works on all other platform.


6) anything else?


My EGL config:



const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_BLUE_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8,
EGL_NONE
};


Initial setup:



glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, ctx->frameW, ctx->frameH, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL); /* also for U/V */


subsequent partial replacement:



glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, ctx->frameW, ctx->frameH, GL_LUMINANCE, GL_UNSIGNED_BYTE, yBuffer); /*also for U/V */


I am trying to render video at ~30FPS or ~60FPS at SD or 720P HD resolution.



.

stackoverflow.comm

[General] Messaging problems with an automated text from an email.


I have an odd problem and my searches for solutions have come up blank. I have a Nexus 4 running 4.2 on NET10. I receive automated text messages from an email address, but the number it comes from changes every message. Can i get these to all link together under one contact? the numbers are 1410000xxx where xxx are steadily increasing numbers(1410000001, 1410000002,1410000003). Any thoughts?



.

forum.xda-developers.com

[android help] How to update UI using thread in IPC mechanism of android


In one of my application project I have to get a data from JNI using AIDL interface. The AIDL interface is like below



interface IBiometricService {

int intFromJNI();

}


For above function I am getting data from JNI class. For the next step I am using service class to access data from AIDL stub,Its like below


public class BService extends Service{



@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
System.out.println("inside service");
td = new MyThread();
td.start();

}

@Override
public IBinder onBind(Intent intent) {

// TODO Auto-generated method stub

return bms;
}

@Override
public int intFromJNI() throws RemoteException {
// TODO Auto-generated method stub
data = BMService.intFromJNI();

}

private class MyThread extends Thread{


@Override
public void run() {
// TODO Auto-generated method stub
super.run();

try {
sleep((int)(Math.random() * 10000));

System.out.println("inside MyThread" +data);

} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}


}


In the above function intFromJNI() I am getting data but I need use thread mechanisam to access the data. How to use it in the above class and how to update data into UI.


Thanks Shiv



.

stackoverflow.comm

[android help] SQLitedatabase every username has the same list


In my application's database I have 2 tables one called "PLAYERS" which holds the data of every user and "FRIENDSLIST" which is intended to be a personal "friends" list for every registered account.How the process goes in my app is that when a player (Joe) registers a Username his information goes into the "PLAYERS" table and now he could go into my FindFriends activty,search the app for his friend's Username (Bob) and then clicks the ADD button.


The friend (Bob) then gets added to the "FRIENDSLIST" table.When he goes into the PlayAFriend activity a list will load showing the "friends" that he added.All this works good until I realized that when I log into one of his friend's account (Bob) ,that friend has the same list that (Joe) has.


I know that the cursor I'm using to load up (Joe)'s friends list is the same cursor I'm using to load up (Bob)'s friends list so the question I'm asking is,


how would I make Joe and Bob have their own personal friends list?


I've tried searching on this website and googling to find any examples on how to accomplish this but I find it crazy that I'm not finding any tutorials or posts on this subject even though this type of practice is used in every popular app made.Sorry for the long post I know it's not a simple question so that's why I had to explain in detail on what the problem is.


I'm posting up my DBAdapter class to show if how I made it would accommodate this and my PlayAFriend class to show my Cursor and ListView in action.


DBAdapter class



package com.fullfrontalgames.numberfighter;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBAdapter {
static final String KEY_ROWID = "_id";

static final String KEY_USERNAME = "USERNAME";

static final String KEY_PASSWORD = "PASSWORD";

static final String KEY_EMAIL = "EMAIL";

static final String KEY_NUMBERINPUT = "NUMBERINPUT";

static final String KEY_SCORE = "SCORE";

static final String KEY_FRIENDS = "FRIENDS";

static final String TAG = "DBAdapter";

static final String DATABASE_NAME = "NFDatabase";

static final String DATABASE_TABLE1 = "PLAYERS";

static final String DATABASE_TABLE2 = "FRIENDSLIST";

static final int DATABASE_VERSION = 4;

static final String DATABASE_CREATE_TABLE1 = "create table PLAYERS ( _id integer primary key autoincrement, "
+ "USERNAME text not null unique,PASSWORD text not null,EMAIL text,NUMBERINPUT text,SCORE text);";

static final String DATBASE_CREATE_TABLE2 = "create table FRIENDSLIST (_id integer primary key autoincrement,"
+ "FRIENDS text not null,USERNAME text ,NUMBERINPUT text,SCORE text);";

final Context context;

DatabaseHelper DBHelper;

static SQLiteDatabase db;

public DBAdapter(Context ctx) {
this.context = ctx;
DBHelper = new DatabaseHelper(context);
}

private static class DatabaseHelper extends SQLiteOpenHelper {

public DatabaseHelper(Context context) {
// TODO Auto-generated constructor stub
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
try {
db.execSQL(DATABASE_CREATE_TABLE1);
db.execSQL(DATBASE_CREATE_TABLE2);
} catch (SQLException e) {
e.printStackTrace();
}
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion
+ ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS PLAYERS");
db.execSQL("DROP TABLE IF EXISTS FRIENDSLIST");
onCreate(db);
}

}

public DBAdapter open() throws SQLiteException {
db = DBHelper.getWritableDatabase();
return this;
}

public void close() {
DBHelper.close();
}

// PLAYERS TABLE CRUD

public long insertPlayer(String Username, String Password, String Email) {
ContentValues initialValues = new ContentValues();
initialValues.put("USERNAME", Username);
initialValues.put("PASSWORD", Password);
initialValues.put("EMAIL", Email);

db.insert("PLAYERS", null, initialValues);

return db.insertWithOnConflict("PLAYERS", null, initialValues,
SQLiteDatabase.CONFLICT_IGNORE);
}

public boolean deletePlayer(long id) {
Log.d(TAG, "delete is working");
return db.delete("PLAYERS", KEY_ROWID + " = " + id, null) > 0;

}

public Cursor getAllPlayers() {
return db.query(false, "Players", new String[] {
"_id", "USERNAME", "PASSWORD", "EMAIL"
}, null, null, null, null, null, null);

}

public String getData() {
String[] columns = new String[] {
"_id", "USERNAME", "PASSWORD"
};
Cursor mCursor = db.query("PLAYERS", columns, null, null, null, null, null);
String result = "";
int iRow = mCursor.getColumnIndex(KEY_ROWID);
int iName = mCursor.getColumnIndex(KEY_USERNAME);

for (mCursor.moveToFirst(); !mCursor.isAfterLast(); mCursor.moveToNext()) {
result = mCursor.getString(iRow) + " " + mCursor.getString(iName) + "/n";
}
return result;
}

public Cursor getPlayer(int _id) throws SQLException {
Cursor mCursor = db.query(true, "PLAYERS", new String[] {
"_id", "USERNAME"
}, KEY_ROWID + " = " + "_id", null, null, null, null, null);
while (mCursor.moveToNext()) {
int id = mCursor.getInt(mCursor.getColumnIndex("_id"));
}
return mCursor;
}

public String getUsername(String Username) {
Cursor mCursor = db.query("Players", new String[] {
"USERNAME"
}, "USERNAME = ?", new String[] {
Username
}, null, null, null);
if (mCursor.moveToNext())
return mCursor.getString(0);
else
return "";
}

public String getSinlgeEntry(String Username) {
Cursor cursor = db.query("PLAYERS", null, " USERNAME=?", new String[] {
Username
}, null, null, null);
if (cursor.getCount() < 1) // UserName Not Exist
{
cursor.close();
return "NOT EXIST";
}
cursor.moveToFirst();
String password = cursor.getString(cursor.getColumnIndex("PASSWORD"));
cursor.close();
return password;
}

public boolean updatePlayer(long _id, String Username, String Password, String Email) {
ContentValues args = new ContentValues();
args.put("USERNAME", Username);
args.put("PASSWORD", Password);
args.put("EMAIL", Email);
return db.update("PLAYERS", args, KEY_ROWID + " = " + _id, null) > 0;
}

// FRIENDS TABLE CRUD

public void insertFriend(String Friend) {
ContentValues initialValues = new ContentValues();
initialValues.put("FRIENDS", Friend);
db.insert("FRIENDSLIST", null, initialValues);
}

public boolean deleteFriend() {
return db.delete("FRIENDSLIST", KEY_ROWID + " = " + "_id", null) > 0;
}

public Cursor getAllFriends() {
return db.query(false, "FRIENDSLIST", new String[] {
"_id", "FRIENDS"
}, null, null, null, null, null, null);
}

public Cursor getFriend(long rowid) throws SQLException {
Cursor mCursor = db.query(true, "FRIENDSLIST", new String[] {
"_id", "FRIENDS"
}, KEY_ROWID + " = " + "_id", null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}

public boolean updateFriend(long _id, String Friends) {
ContentValues args = new ContentValues();
args.put("FRIENDS", Friends);

return db.update("FRIENDSLIST", args, KEY_ROWID + " = " + _id, null) > 0;
}

}


PlayAFriend Class



package com.fullfrontalgames.numberfighter;

import android.app.ListActivity;
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.TextView;

public class PlayAFriend extends ListActivity {

DBAdapter DBAdapter;

@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.playafriend);

final DBAdapter db = new DBAdapter(this);
DBAdapter = db.open();

getListView().setAdapter(new FriendsListAdapter(this, db.getAllFriends()));

}

private class FriendsListAdapter extends BaseAdapter implements OnClickListener, ListAdapter {
private Cursor fFriends;

private Context fContext;

public FriendsListAdapter(Context context, Cursor friends) {
// TODO Auto-generated constructor stub
fContext = context;
fFriends = friends;
}

@Override
public int getCount() {
// TODO Auto-generated method stub
return fFriends.getCount();
}

@Override
public FriendInfo getItem(int position) {
// TODO Auto-generated method stub
if (fFriends.moveToPosition(position)) {
String name = fFriends.getString(fFriends.getColumnIndex("FRIENDS"));

return new FriendInfo(name);
}
return null;
}

@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
fFriends.moveToPosition(position);
return fFriends.getLong(fFriends.getColumnIndex("_id"));
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
if (convertView == null) {
convertView = LayoutInflater.from(fContext).inflate(R.layout.playafriendlistitems,
parent, false);
}
FriendInfo friendinfo = getItem(position);
TextView friendTV = ViewHolder.get(convertView, R.id.textview_friends);
Button playbutton = ViewHolder.get(convertView, R.id.playbutton, position);
playbutton.setOnClickListener(this);

friendTV.setText(friendinfo.getName());

return convertView;
}

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
DBAdapter db = new DBAdapter(fContext);
db.open();
int position = (Integer)v.getTag();
fFriends.moveToPosition(position);
long id = fFriends.getLong(fFriends.getColumnIndex("_id"));
fFriends = db.getAllFriends();
db.close();
}

}

}


.

stackoverflow.comm

[android help] Changing content provider package after refactor


I forked the IOSchedule app from last year's Google IO. I want to make sure I can get an API key which means I need to sign the application and it doesn't have conflicts with the content provider which means I need to refactor. However every time I try to use the Android Tools > Refactor Package Name, I get issues, namely with modifying a content provider.


This is the tag for the content provider:



android:name="com.google.android.apps.iosched.provider.ScheduleProvider"
android:authorities="com.google.android.apps.iosched"
android:label="@string/app_name"
android:syncable="true"
android:writePermission="com.google.android.apps.iosched.permission.WRITE_SCHEDULE" />


I've been trying to change it to the following:



android:name="com.google.android.apps.iosched.provider.ScheduleProvider"
android:authorities="org.mrkaiser.android.apps.iosched"
android:label="@string/app_name"
android:syncable="true"
android:writePermission="com.google.android.apps.iosched.permission.WRITE_SCHEDULE" />


However at runtime I get the following error:


04-22 21:29:13.818: E/AndroidRuntime(12329): java.lang.NullPointerException 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.google.android.apps.iosched.ui.MyScheduleFragment.onLoadFinished(MyScheduleFragment.java:175) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.google.android.apps.iosched.ui.MyScheduleFragment.onLoadFinished(MyScheduleFragment.java:1) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:424) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:392) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.Loader.deliverResult(Loader.java:103) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:81) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:35) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:221) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:61) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask.finish(ModernAsyncTask.java:461) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask.access$500(ModernAsyncTask.java:47) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.support.v4.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:474) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.os.Handler.dispatchMessage(Handler.java:99) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.os.Looper.loop(Looper.java:137) 04-22 21:29:13.818: E/AndroidRuntime(12329): at android.app.ActivityThread.main(ActivityThread.java:5226) 04-22 21:29:13.818: E/AndroidRuntime(12329): at java.lang.reflect.Method.invokeNative(Native Method) 04-22 21:29:13.818: E/AndroidRuntime(12329): at java.lang.reflect.Method.invoke(Method.java:511) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) 04-22 21:29:13.818: E/AndroidRuntime(12329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562) 04-22 21:29:13.818: E/AndroidRuntime(12329): at dalvik.system.NativeStart.main(Native Method)


I'm not sure what I'm doing wrong. If I try and refactor the packages R gets out of sync along with some xml files and I can't recover.



.

stackoverflow.comm

[android help] My Android emulator won't launch and there are no errors, any ideas?

My Android emulator won't launch and there are no errors, any ideas? - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















When I try to run my application as an Adroid App this is what my console reports:


[2011-10-22 15:21:32 - HelloWorldAndroid] ------------------------------
[2011-10-22 15:21:32 - HelloWorldAndroid] Android Launch!
[2011-10-22 15:21:32 - HelloWorldAndroid] adb is running normally.
[2011-10-22 15:21:32 - HelloWorldAndroid] Performing Hello.World.MyHelloWorld activity launch
[2011-10-22 15:21:32 - HelloWorldAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'Android_1.5_Emulator'
[2011-10-22 15:21:32 - HelloWorldAndroid] Launching a new emulator with Virtual Device 'Android_1.5_Emulator'


When I open the AVD Manager says that it is valid. When I click start I get a quick loading screen and then it closes and thats it. I have changed the launch action in the configuration. I have deleted and recreated the emulator and the Android project. I am also using Ubuntu 11.10. Does anyone have ideas on the problem?


























Try launching the emulator manually with adb and see if an error is reported. You could also try



adb kill-server
adb start-server






















This worked for me. adb kill-server then adb start-server then cd ..\tools then emulator -avd . See also My Android emulator won't launch and there are no errors, any ideas?




















default






.

stackoverflow.comm

[android help] Simplest Method to Start AlarmManager With Time Value In Standard Format (ex 7:30)


I'd like to start my AlarmManager activity at a time specified by the user however the time string is stored in standard format (ex - 7:30) how can I use the AlarmManager to interact with a long value which is stored in standard format - instead of miliseconds as it usually is? Is it possible to do this without converting it into miliseconds? If so - how? If not - what is the 2nd best alternative? (I simply need to know the easiest way to wake an alarm if my time string is in standard format.)


SOURCE:



String time = 7:30
Intent intent2 = new Intent(New.this, Start.class);
PendingIntent pintent2 = PendingIntent.getActivity(Rules.this, 0, intent2,
0);
AlarmManager alarm2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm2.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
time != null ? 1000 : 0, pintent2);


EDIT:


I'm attempting to use the following method I found: Date d = DateFormat.parse(time); long millisec = d.getTime(); but I'm getting an error stating "The method parse(String) is undefined for the type DateFormat" - any ideas why?



.

stackoverflow.comm

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...