Tuesday, April 30, 2013

[General] airplane mode


Hello, can you provide a little more details of your situation ?

Phone, carrier, are you rooted or stock?

Things leading up to this happening..

Thank you.



.

forum.xda-developers.com

[General] Having an issue with my Droid Citrius


I'm not a battery expert, but I think when it's dead, it's dead. I was going to suggest that you try a different charging cable, but your original post mentioned that you tried several different chargers, so if that's the case, it isn't a cable problem. It could be the charging port on the phone, but if that were the case, then you're probably better off getting a new phone rather than paying to repair it. If you know someone else with the same phone, you could always try to swap batteries and see if it will charge up on the other person's phone, which would strongly suggest a problem with your charge port.



.

forum.xda-developers.com

[General] iTunes DRM "protected" Songs and Movies - help!


I have a chunk of songs and about 8 movies with the "protected" drm on it....

ive searched but mostly find apps for windows, im on a mac... how can i convert or strip the drm to allow me to play these on my samsung galaxy s4?



.

forum.xda-developers.com

[General] Getting Volume Keys to Wake the Screen


I bought a Cobalt SP300 on eBay and one of its faults is that the power button on top is a little shallow and hard to push...unfortunately it's the only way to wake the screen. I really want to use the volume keys to wake up the screen. I've tried a button remapper app (didn't work correctly) and tried an app called No Lock which disables the lock screen and allows you to wake the screen with the volume keys. The problem with it is that it only works like 10% of the time and I like the lock screen as well.

I think my only other option at this point is to manually try to edit the files. I found out how to root my phone and then through root explorer went to system/usr/keylayout and there is a file I think maps the buttons: mt6575-kpd.kl

I find




key 115 VOLUME_UP WAKE_DROPPED

key 114 VOLUME_DOWN WAKE_DROPPED

key 113 MUTE WAKE_DROPPED

key 112 POWER WAKE

So I see the volume keys say WAKE_DROPPED instead of just wake. According to a search I did by what the dropped part means, it should still wake the screen but it doesn't. Would it be sensible to edit these to only wake? Do I chance bricking my phone doing this? I tried to backup my phone using MTKDroidTools but I can't get the backup function to work...


.

forum.xda-developers.com

[General] Gmail App Notifications - Menu Button Missing


Hi

Im brand new to Android - just got myself an S3 i9305 this afternoon

Im having an issue with my gmail notifications. I still want to receive gmail notifications on my home screen (the app icon where the image shows how many emails) however I dont want it to play a sound.

I googled how to remove the sound, but all the walk throughs start with tapping a 'menu' button (three vertical square dots) at the bottom left in the gmail app. I dont see this menu button - see image below

Any ideas why?



.

forum.xda-developers.com

[android help] List View Item row click Caused by: java.lang.NumberFormatException


I am writing a Cart App in which i need to open that particular item in an activity, which has been clicked by the user in List View.


I am using two different activities, one to show selected Item(s) in a List View namely CartActivity.java and second to show any of the selected item in another activity namely ProductInformationActivity.java


I have written code to call that particular item in an activity, which has been selected by user, in a List View of CartActivity.java


CartAdapter.java:



public View getView(final int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View vi = convertView;
if (convertView == null)
vi = inflater.inflate(R.layout.listrow_cart, null);
vi.setClickable(true);
vi.setFocusable(true);
vi.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v)
{
HashMap prod = new HashMap();
prod = Constants.mItem_Detail.get(position);
Intent mViewCartIntent = new Intent
(activity,ProductInformationActivity.class);
mViewCartIntent.putExtra("product", prod);
activity.startActivity(mViewCartIntent);
}
});


ProductInformationActivity.java:



public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.information_product);

// below is the line number 77

itemamount = Double.parseDouble(text_cost_code.getText().toString());
txt_total.setText(Double.toString(itemamount));
edit_qty_code.addTextChangedListener(new TextWatcher() {


But whenever i do click on any of the item in a ListView, i am not getting that particular item in ProductInformationActivity.java, getting an Error message that says : Force Close Logcat Says:



04-30 14:37:10.073: E/AndroidRuntime(273): FATAL EXCEPTION: main
04-30 14:37:10.073: E/AndroidRuntime(273): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.era.restaurant.versionoct/com.era.restaurant.versionoct.menu.ProductInformationActivity}: java.lang.NumberFormatException:
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-30 14:37:10.073: E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
04-30 14:37:10.073: E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
04-30 14:37:10.073: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-30 14:37:10.073: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-30 14:37:10.073: E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)
04-30 14:37:10.073: E/AndroidRuntime(273): Caused by: java.lang.NumberFormatException:
04-30 14:37:10.073: E/AndroidRuntime(273): at org.apache.harmony.luni.util.FloatingPointParser.parseDouble(FloatingPointParser.java:267)
04-30 14:37:10.073: E/AndroidRuntime(273): at java.lang.Double.parseDouble(Double.java:287)
04-30 14:37:10.073: E/AndroidRuntime(273): at com.era.restaurant.versionoct.menu.ProductInformationActivity.onCreate(ProductInformationActivity.java:77)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-30 14:37:10.073: E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-30 14:37:10.073: E/AndroidRuntime(273): ... 11 more


.

stackoverflow.comm

[android help] Add Custom Layer in Google maps v2 in Android


I want to create a custom Layer(Like traffic , etc in google maps v2) in Google maps, which will show some geo points that I will given to mapview. Is there any possibility of implementing this in google maps with the new API ?? If so please provide some methods and code samples.


Thanks



.

stackoverflow.comm

[android help] android:background don't work except for overview


I work on an Android application, and I just try to put a background on an empty activity by way of welcome in the application. In the overview of the xml file, the image is displayed, but when i try the app on the emulator or on my phone, she's not displayed. They have no error, I don't understand. Can someone help me please ?



public class MainActivity extends Activity {

private SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Intent i = new Intent(this, ListeContact.class);
try
{
Thread.sleep(3000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
startActivity(i);
this.finish();
}
}


activity_main.xml :




android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/fond">



P.S. My image named fond.png is on 5 folder named drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xdpi and drawable-xxdpi.



.

stackoverflow.comm

[android help] "Unable to open log device '/dev/log/main': No such file or directory"


I am new to Android development and bought a cheap Huawei Sonic (U8650 apparently) so I could test my first attempts at making an app on an actual device.


However, whenever I try to use 'adb logcat' or 'adb shell' then 'logcat' on the device I get:



Unable to open log device '/dev/log/main': No such file or directory


I have already enabled Usb debugging in Settings -> Developer.


I just don't know enough about Android to know if this is something I can even fix.


I have found two other questions with similar problems:


/dev/log/main not found


??-?? ??:??:??.???: INFO/(): Unable to open log device '/dev/log/main': No such file or directory


...but they both turned out to be using some kind of non standard kernel that had logging disabled. Mine is a stock phone out of the box.


It's a very cheap but snappy Android 2.3 phone, so hopefully it wasn't a total waste of money.


Any help would be greatly appreciated.



.

stackoverflow.comm

[android help] Android Google Analytics V2 myTracker


I would like to track a view in my Android application using Manual Screen Tracking. I read here https://developers.google.com/analytics/devguides/collection/android/v2/screens that I need to use this code:



myTracker.trackView("Home Screen");


But Eclipse shows an error (myTracker cannot be resolved) when I use it.


I have no trouble with EasyTracker.



import com.google.analytics.tracking.android.EasyTracker;

EasyTracker.getInstance().activityStart(this);


.

stackoverflow.comm

[android help] Change MapView in GoogleMaps v2 with a checkbox on Android


I can't change the map type on my Android Application, everything work fine but this feature is not.


This is a part of the MapActivity class



public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN );
this.locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
mMapFragment = MapFragment.newInstance();
setContentView(R.layout.activity_map_fabio);
options.mapType(GoogleMap.MAP_TYPE_NORMAL)
.compassEnabled(true)
.scrollGesturesEnabled(true)
.zoomGesturesEnabled(true)
.tiltGesturesEnabled(true);
MapFragment.newInstance(options);
mMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
android.app.FragmentTransaction fragmentTransaction =
getFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.map, mMapFragment);

fragmentTransaction.commit();

satellite = (CheckBox) findViewById(R.id.satellite);
satellite.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
if (satellite.isChecked()){
mMap.getUiSettings().setAllGesturesEnabled(true);
options.mapType(GoogleMap.MAP_TYPE_SATELLITE);
}
}
});


The check is listened but the map doesn't change the view.



.

stackoverflow.comm

Monday, April 29, 2013

[General] Music to sd card


Agree with above. I would also recommend putting the music in a directory called "Music," if there isn't one already on the SD card. This is the typical default directory that various music players will look for. Once you pop that SD card back in, most music players will scan the directory and show your music files in your library, but sometimes you have to tell the music player where to look, and sometimes you have to tell the music player to re-scan the directories for added media. Which music player are you using?



.

forum.xda-developers.com

[android help] Change date displayed in button to DDth MMMM YY but keep values as DD/MM


I am using a DatePicker so that the user can select a date and find out the sunrise and sunset times for that particular date. The webservice I am using requires the date to be snet in the following format dd/MM but I would like the button to show the date in the format DDth MMMM YYYY e.g 21st March 2013


Any advice on how I should I go about doing this?


Code below as requested:



public class SunriseSunset extends Activity implements OnClickListener {

public Button getLocation;
public Button setLocationJapan;
public TextView LongCoord;
public TextView LatCoord;
public double longitude;
public double latitude;
public LocationManager lm;
public Spinner Locationspinner;
public DateDialogFragment frag;
public Button date;
public Calendar now;

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

//Date stuff
now = Calendar.getInstance();
date = (Button)findViewById(R.id.date_button);
date.setText(String.valueOf(now.get(Calendar.DAY_OF_MONTH)+1)+"-"+String.valueOf(now.get(Calendar.MONTH))+"-"+String.valueOf(now.get(Calendar.YEAR)));
date.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
showDialog();
}
});

}
// More date stuff
public void showDialog() {
FragmentTransaction ft = getFragmentManager().beginTransaction(); //get the fragment
frag = DateDialogFragment.newInstance(this, new DateDialogFragmentListener(){
public void updateChangedDate(int year, int month, int day){
date.setText(String.valueOf(day)+"-"+String.valueOf(month+1)+"-"+String.valueOf(year));
now.set(year, month, day);
}
}, now);

frag.show(ft, "DateDialogFragment");

}

public interface DateDialogFragmentListener{
//this interface is a listener between the Date Dialog fragment and the activity to update the buttons date
public void updateChangedDate(int year, int month, int day);
}

public void addListenerOnSpinnerItemSelection() {
Locationspinner = (Spinner) findViewById(R.id.Locationspinner);
Locationspinner
.setOnItemSelectedListener(new CustomOnItemSelectedListener(
this));
}

private class LongRunningGetIO extends AsyncTask {

protected String getASCIIContentFromEntity(HttpEntity entity)
throws IllegalStateException, IOException {
InputStream in = entity.getContent();
StringBuffer out = new StringBuffer();
int n = 1;
while (n > 0) {
byte[] b = new byte[4096];
n = in.read(b);
if (n > 0)
out.append(new String(b, 0, n));
}
return out.toString();
}

@Override
protected String doInBackground(Void... params) {
HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();

// Finds todays date and adds that into the URL
SimpleDateFormat df = new SimpleDateFormat("dd/MM");
String formattedDate = df.format(now.getTime());

String finalURL = "http://www.earthtools.org/sun/"
+ LatCoord.getText().toString().trim() + "/"
+ LongCoord.getText().toString().trim() + "/"
+ formattedDate + "/99/0";
HttpGet httpGet = new HttpGet(finalURL);
String text = null;

try {
HttpResponse response = httpClient.execute(httpGet,
localContext);
HttpEntity entity = response.getEntity();
text = getASCIIContentFromEntity(entity);
} catch (Exception e) {
return e.getLocalizedMessage();
}
return text;
}

protected void onPostExecute(String results) {
if (results != null) {
try {

DocumentBuilderFactory dbFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
InputSource s = new InputSource(new StringReader(results));
Document doc = dBuilder.parse(s);
doc.getDocumentElement().normalize();
TextView tvSunrise = (TextView) findViewById(R.id.Sunrise);
TextView tvSunset = (TextView) findViewById(R.id.Sunset);
tvSunrise.setText(doc.getElementsByTagName("sunrise").item(0).getTextContent());
tvSunset.setText(doc.getElementsByTagName("sunset").item(0).getTextContent());
} catch (Exception e) {
e.printStackTrace();
}
}
Button b = (Button) findViewById(R.id.CalculateSunriseSunset);
b.setClickable(true);
}
}

class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
}

@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}

@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
}

}


DateDialogFragment:



import java.util.Calendar;

import richgrundy.learnphotography.SunriseSunset.DateDialogFragmentListener;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.os.Bundle;
import android.widget.DatePicker;

public class DateDialogFragment extends DialogFragment {

public static String TAG = "DateDialogFragment";
static Context mContext; //I guess hold the context that called it. Needed when making a DatePickerDialog. I guess its needed when conncting the fragment with the context
static int mYear;
static int mMonth;
static int mDay;
static DateDialogFragmentListener mListener;

public static DateDialogFragment newInstance(Context context, DateDialogFragmentListener listener, Calendar now) {
DateDialogFragment dialog = new DateDialogFragment();
mContext = context;
mListener = listener;
mYear = now.get(Calendar.YEAR);
mMonth = now.get(Calendar.MONTH);
mDay = now.get(Calendar.DAY_OF_MONTH);
return dialog;
}


public Dialog onCreateDialog(Bundle savedInstanceState) {
return new DatePickerDialog(mContext, mDateSetListener, mYear, mMonth, mDay);
}


private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {

@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;

mListener.updateChangedDate(year, monthOfYear, dayOfMonth);
}
};

}


Your help would be greatly appreciated.


Please ask questions for clarification if need =)


----------------UPDATE-------------------------


I'm getting there, updated code now looks like this:



public void showDialog() {
FragmentTransaction ft = getFragmentManager().beginTransaction(); //get the fragment
frag = DateDialogFragment.newInstance(this, new DateDialogFragmentListener(){

public void updateChangedDate(int year, int month, int day){
DateFormat format = new SimpleDateFormat("DD MM yyyy"); // could be created elsewhere
now.set(year, month, day);
date.setText(format.format(now.getTime()));
date.setText(String.valueOf(day)+"-"+String.valueOf(month+1)+"-"+String.valueOf(year));
now.set(year, month, day);
}
}, now);

frag.show(ft, "DateDialogFragment"); }


.

stackoverflow.comm

[General] Charge Phone Broken Charging Port?


Is there a way to charge my phone with a broken charging port?

Will this work?

--

Also, is there any way to buy a new battery cover for my phone? Motorola Triumph



.

forum.xda-developers.com

[android help] Selected Tab in TabHost not come to center


I am having a TabHost that have 5 tabs. I want to center the tab that is selected. So far i tried will give in following.


Declarations in onCreate:



scale = getApplicationContext().getResources().getDisplayMetrics().density;

screenWidth = getWindowManager().getDefaultDisplay().getWidth();

for (int i = 0; i < mTabHost.getTabWidget().getTabCount(); i++)
{
mTabHost.getTabWidget().getChildTabViewAt(i).getLayoutParams().width = (int) tabWidth;
}


This is onTabChanged method:



@Override
public void onTabChanged(String tabId) {
int position = mTabHost.getCurrentTab();
mViewPager.setCurrentItem(position);
mTabHost.getTabWidget().getChildAt(position).setBackgroundResource(R.drawable.tab_background_selector);
SearchIndexActivity searchIndexActivity = new SearchIndexActivity();
Calculation calculation = searchIndexActivity.new Calculation();
calculation.TabCalculation(position);
mHorizontalScrollView.scrollTo(offset, 0);
}


This is the class that makes the calculation for centering the tab.



public class Calculation
{
public void TabCalculation(int position)
{
tabWidth = (int) (150 * scale + 0.5f);

nrOfShownCompleteTabs = ((int) (Math.floor(screenWidth
/ tabWidth) - 1) / 2) * 2;
remainingSpace = (int) ((screenWidth - tabWidth - (tabWidth * nrOfShownCompleteTabs)) / 2);
Log.e("postion in TabCalculation", String.valueOf(position));
//a = (int) (mTabHost.getCurrentTab() * tabWidth);
a = (int) (position * tabWidth);
b = (int) ((int) (nrOfShownCompleteTabs / 2) * tabWidth);
Log.e("a value", String.valueOf(a));
Log.e("b value", String.valueOf(b));
Log.e("tabWidth", String.valueOf(tabWidth));
offset = (a - b) - remainingSpace;
Log.e("offset", String.valueOf(offset));
}


This is all i have done. But tab is not come center. It just come to first tab. Current tab is not coming in center of the screen.


Where am going wrong. Anyone can help me to find out.



.

stackoverflow.comm

[android help] LocalStorage store not persisting on Android phone when app stops using Sencha Touch 2.2 and Phonegap


This is working fine in my browser but when I install the app on my phone and use it ... it looks fine UNTIL I force it to stop and reopen the app and then all my records are gone.


Im using 2.2 and Phonegap.... any help would be VERY appreciated. Here is my store:



Ext.define('MyApp.store.Presentations', {
extend: 'Ext.data.Store',

config: {
model: 'MyApp.model.Presentations',
sorter: 'title',
grouper: function (record) {
var upperCased = record.get('title')[0].toUpperCase();
return upperCased; //First letter of the title - how we GROUP these
},
autoLoad: true,
proxy: {
type: 'localstorage',
id: 'presentations'
}
}
});


I save like this:



var newPresentation = { title: prezTitle, content: '' };
Ext.getStore('Presentations').add(newPresentation);
var newRecord = Ext.getStore('Presentations').sync();


.

stackoverflow.comm

[General] Very Under-qualified


I'm not sure if this is the right place for this thread, but oh well.

So I thought I was ready for rooting, and it turns out that it is way over my head. A month back, I tried rooting my Galaxy Nexus, and I think I ruined it beyond repair. When I turn the phone on, the Google logo displays and it doesn't get any further into the booting process.

Since then, I found another on Craigslist, but I've been very hesitant about trying the rooting process again. Just thought I'd share my story, maybe someone can help me out next time I try.



.

forum.xda-developers.com

[android help] action bar item onoptionitemselected


I'm using action bar in my application and I want when the user clicks a button, the item in action bar should change text.


This is my code for onOptionsItemSelected()



public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_refresh:
Toast.makeText(this, "Menu Item 1 selected", Toast.LENGTH_SHORT)
.show();
finish();
break;
case R.id.lg:

Toast.makeText(getBaseContext(), "ma", Toast.LENGTH_SHORT).show();
break;

case R.id.French:

Toast.makeText(getBaseContext(), "zaki", Toast.LENGTH_SHORT).show();

break;
case R.id.nerlandais:
Toast.makeText(getBaseContext(), "brahim", Toast.LENGTH_SHORT)
.show();

}

return true;
}


What must I do to add to change the item title from another item.


Example: When I click in French item I want to change nerlandais item title.



.

stackoverflow.comm

[General] Firefox and Chrome - change focus to New Tab?


How do you force Firefox and Chrome (this is two questions) to change focus to a new tab when you open a link in a new tab? I'm looking for same behavior like in the windows versions, but cannot find any settings to do it.

I tried the Dolphin browser and I see it does that already, without having to set any configuration.



.

forum.xda-developers.com

[android help] Where the "myfilename.txt" in android phone being stored?


I compiled this project in Eclipse.


It is an android app.


I run it in my samsung mobile. But I'm still wondering where the "myfilename.txt" is stored in the android phone.



.

stackoverflow.comm

[android help] How to increase icon size of actionButton in SherlockActionBar?


To define the actionButton and set its icon, I would:




android:id="@+id/m_login"
android:enabled="true"
android:showAsAction="always"
android:icon="@drawable/login"/>




The resulted icon(drawable/ldpi) looks very small by default: (Any way to increase the size?)


enter image description here


Here's the icon:


enter image description here



.

stackoverflow.comm

[General] Titanium Back froze my phone


I have a nexus phone that is unlocked and rooted. I installed titanium backup and backed everything up. I was trying to set a widget on the home page to freeze and defrost apps and by mistake hit freeze all apps. I stopped it as fast as I could and was able to defrost all apps but not when to to the phone on the screen is dark and there is a box that says "unfortunately. Phone has stooped" I have pulled battery and it still does it.



.

forum.xda-developers.com

[General] Google Music general questions and issues.


I'm just going to name a bunch of issues that keep me from using it. I'd like to use it though since it has more settings and a lock screen controller.

When I'm playing a song, and the song is on-screen, when I turn the screen to change viewing positions the cover art will go away and the timer will go to "--:--" and the only way to make it go back to normal is to either press thumbs up or down. Or, go to the next song. There is also like 3 other ways this can happen.

General problems with album art. Not showing, not showing correctly, disappearing (see above) etc.

The EQ animation in the song/album list will continue to play even when the music is paused.

I think a understated the first problem since I apparently can't think of any more. I don't know if I'm the only one who has this problem but I basically can't use the app because of this. Even without going that far, there isn't enough pros to use it over the stock player.

Does anyone else have this issue? I'm on the latest version and it happened on a much older version as well, before I updated.



.

forum.xda-developers.com

[android help] sqlite statement is ok, right?


When I use the sentence below works fine!



this.getWritableDatabase().execSQL(
"UPDATE table SET assistance =assistance + 1 WHERE alum ='Saul'");


But when I tried doing it passing a variable like this:



this.getWritableDatabase().execSQL(
"UPDATE table SET assistance =assistance + 1 WHERE alum ='"+names[i]+"'");


Don't work at all : ( it does not hive me any errors but my assistance field don't goes up by 1, by the way the statement above is inside a loop, that's because I want to update all the assistance fields that match whit my names (names[i]). Sorry for my English and please help


//edit:


so here is the method event from one activity that tigger the helper method


public void pasar(View args){



choosennames= new String[500];
for(int i=0;i

TextView viewName= (TextView) findViewById(i);
//an array names
names.add(viewName);


}

for( j = 0;j obj= name.get(j);



for(k=0;k if(obj.getId()==num.get(k))
{

choosennames[z]=obj.getText().toString();

z++;
}
}
}

z=0;
helper.open();
howmany=num.size();
helper.mod(choosennames, howmany);
helper.close();
choosennames=null;


Iterator it = numeros.iterator(); //se crea el iterador it para el array
while(it.hasNext())
System.out.println(it.next());




Intent inten = new Intent(this, MainLista.class);
this.finish();

Toast toast1 =
Toast.makeText(getApplicationContext(),
"Pase de lista exitoso : )", Toast.LENGTH_SHORT);

toast1.show();
startActivity(inten);





}


And finally this is my method "mod" inside the helpers class:


public void mod(String []names,int howmany){



for(int i=0;i System.out.println("exectSQL:"+names[i]);

System.out.println("UPDATE alumnos SET asistencia =asistencia + 1 WHERE alumno ='"+names[i]+"'");

this.getWritableDatabase().execSQL(
"UPDATE alumnos SET asistencia =asistencia + 1 WHERE alumno ='"+names[i]+"'");



}




}


.

stackoverflow.comm

Sunday, April 28, 2013

[android help] How to align view elements in Relativelayout dynamically through code in Android?



layout.addView(cb1);

lp.addRule(RelativeLayout.BELOW,cb1.getId());
cb2.setLayoutParams(lp);
layout.addView(cb2);

lp.addRule(RelativeLayout.BELOW,cb2.getId());
cb3.setLayoutParams(lp);
layout.addView(cb3);


Thanks man this helped me a lot


I guess you are wrong at the point that you are using "lp" as the layout parameters for both cb2 and cb3(you can't add the same rule "RelativeLayout.BELOW" to same layoutparameters object "lp" again and again). Use lp for cb2 and lp2 for cb3 and create like this



RelativeLayout layout = new RelativeLayout(this);

CheckBox cb1 = new CheckBox(this);
cb1.setId(1);
cb1.setText("A");

CheckBox cb2 = new CheckBox(this);
cb2.setId(2);
cb2.setText("B");

CheckBox cb3 = new CheckBox(this);
cb3.setId(3);
cb3.setText("C");

RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
layout.setLayoutParams(lp);

layout.addView(cb1);

lp.addRule(RelativeLayout.BELOW,cb1.getId());
cb2.setLayoutParams(lp);
layout.addView(cb2);

RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);//important

lp2.addRule(RelativeLayout.BELOW,cb2.getId());//important
cb3.setLayoutParams(lp2);//important
layout.addView(cb3);


I think this will work.



.

stackoverflow.comm

[android help] Storing and accessing large tables of static information


I am writing an Android application that reads data from legacy devices, and presents it to the user. Much of this data consists of 16-bit enumerations that represent things like device information, status, errors, etc... There are over 100 of these enumerations.


In the past, the user would have to look up the returned value in a large binder of tables. For example, let's say the device returns an error as 0xFE04. There's some row in some table like this...



+--------+-------------------+------------------+----------+--------------------+
| Code | Short Description | Long Description | Solution | Alternate Solution |
+--------+-------------------+------------------+----------+--------------------+
| 0xFE04 | blah | blahblah | blah | blahblah |
+--------+-------------------+------------------+----------+--------------------+


How can I store these tables in code so that I can return all this information to the user efficiently & effectively.


This may have to be ported in the future for iOS or even windows, so a more language-independent solution is preferred.



.

stackoverflow.comm

[android help] On Google TV How do I make Fullscreen Activity hide title and button properly?

android - On Google TV How do I make Fullscreen Activity hide title and button properly? - 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.

















It would seem that the Fullscreen Activity Demo/Template does not behave the same on Google TV with the way Status/Navigation/Action bar are handled. Note: to make the default template work on Honeycomb I had to make a slight change to the provided SystemUiHiderHoneycomb class (details)


Question: Should the Template work properly? (I think yes). Is there a good way of fixing it without special handling for Google TV detection? What's a good way of achieving the same result of hiding the title at the top and the button at the bottom?


Steps to reproduce:


  1. Create new application via Android Tools wizard

  2. Use Fullscreen Activity as first and only activity

  3. perform code modification to SystemUiHiderHoneycomb class (details)

I tested this on a Google TV emulator and on a real device with the same result. (I also tested it without the change in step 3).


Screenshot of default Fullscreen Activity



















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










default






.

stackoverflow.comm

[android help] SQLite excpetion unable to convert BLOB to string

android - SQLite excpetion unable to convert BLOB to string - 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.

















In my android project I fetch one problem during retrieving data from data base. In this I try to get String value from DB like URL but when this code execute then I get this error android.database.sqlite.SQLiteException: unknown error: Unable to convert BLOB to string And only URL colomn give me this error not any other string colomn.


I didn't get where I am wrong. So friend please give me suggestion how I can resolve this problem. Here I also print my LogCat.


Thank You.



08-22 20:08:12.290: WARN/System.err(10844): android.database.sqlite.SQLiteException: unknown error: Unable to convert BLOB to string
08-22 20:08:12.300: WARN/System.err(10844): at android.database.CursorWindow.getString_native(Native Method)
08-22 20:08:12.300: WARN/System.err(10844): at android.database.CursorWindow.getString(CursorWindow.java:329)
08-22 20:08:12.300: WARN/System.err(10844): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.ProductsDetailsHomeTab.getProductDeatilsFromDB(ProductsDetailsHomeTab.java:337)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.ProductsDetailsHomeTab.setFlipperChild1(ProductsDetailsHomeTab.java:201)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.Widget.ViewFlipper_ProductDetails.onRightToLeftSwipe(ViewFlipper_ProductDetails.java:68)
08-22 20:08:12.300: WARN/System.err(10844): at com.catLog.Widget.ViewFlipper_ProductDetails.onTouchEvent(ViewFlipper_ProductDetails.java:131)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.View.dispatchTouchEvent(View.java:3766)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1676)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1112)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1660)
08-22 20:08:12.300: WARN/System.err(10844): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
08-22 20:08:12.300: WARN/System.err(10844): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 20:08:12.300: WARN/System.err(10844): at android.os.Looper.loop(Looper.java:123)
08-22 20:08:12.300: WARN/System.err(10844): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-22 20:08:12.300: WARN/System.err(10844): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 20:08:12.300: WARN/System.err(10844): at java.lang.reflect.Method.invoke(Method.java:521)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-22 20:08:12.300: WARN/System.err(10844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-22 20:08:12.300: WARN/System.err(10844): at dalvik.system.NativeStart.main(Native Method)




























How to convert BLOB to string?



Direct conversion is not possible without using some UDF, but you can extract text using SUBSTRING function:



What is the datatype of the column you are getting the error on (from what you say I think this is the URL column)? Sounds like it is of type BLOB which is a representation of an image but not a string








































lang-sql






.

stackoverflow.comm

[android help] How can I detect current device is Android Tablet?


Your Galaxy Tab is running Honeycomb or higher, which means that the old Options Menu has been deprecated in favor of Action Bar. That having been said, there's still a menu icon in the title bar (a square with a slash through it in Honeycomb and three square dots in Jelly Bean). If your user clicks that, they get your standard options menu (without menu item icons, however).


The alternative is to run ActionBar Sherlock to give your apps action bars, regardless of OS version.


If you insist on doing your own branching based on OS version, try this:



int sdk = android.os.Build.VERSION.SDK_INT;

if(sdk < android.os.Build.VERSION_CODES.HONEYCOMB)
{
// Gingerbread and earlier
}
else
{
// Honeycomb and later
}


.

stackoverflow.comm

[android help] HTC One X+ Home Sence Launcher won't let me clear defaults programmatically


I want to show Settings->Applications->Manage Applications-> home launcher application ->'Clear Defaults' programmatically in my application.This works fine in all devices except HTC One X+.


In HTC One X+, 'Home Sence' application is set as default home launcher.When i tried to set my application as home launcher this shows Resolver Dialog too.


In my application i want to clear the default settings of current home launcher application and set mine as home launcher.So,I tried this code



Intent intent = new Intent();
final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 9) { // above 2.3
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", packageName, null);
intent.setData(uri);
} else {
// below 2.3
String appPkgName = (apiLevel == 8 ? "pkg" : "com.android.settings.ApplicationPkgName");
intent.setAction(Intent.ACTION_VIEW);
intent.setClassName(APP_DETAILS_PACKAGE_NAME, APP_DETAILS_CLASS_NAME);
intent.putExtra(appPkgName, packageName);
}
this.startActivity(intent);


But it won't let me show the 'Clear Defaults' of HTC Sence.It works for any other application on this device.What is the problem here? Why 'HTC Sence' won't let me to clear defaults?How can i fix this?


Thanks in Advance



.

stackoverflow.comm

[android help] Android Creating Output Files To Extract Them From PC

java - Android Creating Output Files To Extract Them From PC - 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 am trying to make an android app that will create some records in simple text files such that a computer can access those file. I think I understand the process of creating and writing files internally but I can't find these files with the computer when I connect it through USB or an app such as AirDroid. My initial intention was to put the file in a folder (maybe the root folder) which would allow me to grab that information from my personal computer. Is such thing even possible? If it is not, is there an alternative way of accessing the files created by my app? Thanks for your help.
















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










lang-java







.

stackoverflow.comm

[android help] Cannot be resolved to a type: Error


I am getting this error: ShowDialog cannot be resolved to a type


Here is my code:



final CharSequence[] items = {"Low", "Medium", "High"};

AlertDialog.Builder builder = new AlertDialog.Builder(ShowDialog.this);
builder.setTitle("Alert Dialog with ListView");
builder.setIcon(R.drawable.image1);
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
AlertDialog alert = builder.create();

alert.show();


Any ideas why I am getting this annoying error? I have tried to refresh my code and also clean it and still no luck. Thanks



.

stackoverflow.comm

[android help] Android Search Using Fragments

Android Search Using Fragments - 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 need to do an android search using fragments and have been looking at this: Android search with Fragments


I have a couple of questions, however, regarding the 1st answer.


I do not want a new page to pop up; I want the search results to be populated within a listview of the current fragment I am within. Is that possible?


I'm not sure what code to write after:



/**
* Performs a search and passes the results to the container
* Activity that holds your Fragments.
*/

public void doMySearch(String query) {
// TODO: implement this
}


How do I pass my results to a 'container activity' that holds my fragments? Would that be my MainActivity (that's where the code of all my fragments is located)?


























'Container Activity' doesn't specifically your MainActivity as this is the name a lot of devs and example code gives to their landing/home activity.


'Container Activity' refers to the Activity to which your ListView (ListFragment?) and Search Fragment belong.


To post the results (via your TODO code), get the parent Activity (getActivity()) and implement a method on the parent Activity that gets the fragment with the ListView and passes the data to it. You may want to have a method on the ListView that handles this rather than putting it on the Activity. (I like to think of a parent Activity as a delegator)




















default







.

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...