Thursday, April 18, 2013

[General] turning on usb storage mode from computer


I have searched the forums/web for an answer to this question but if it exists, it is buried in discussions of related problems.

The screen on my wife's phone (Samsung Epic 4g) died and so we are trying to move the data off the phone. Normally, you press the
"Turn on USB storage" button to see the storage when connected to a computer. Since the screen is dead, that is not possible.

Is there a way to initiate USB storage mode from the computer?

Thanks!!!



.

forum.xda-developers.com

[General] Can't do hard reset


hello!

so i was installing gingerbread on my galaxy pro b7510.
did back up.
now, it won't boot. everything i see is black screen and some pixels on it. i can't even do hard reset.
my pc wont recognize it.

what to do?



.

forum.xda-developers.com

[General] Outook App not connecting whilst on 3g


Hi All,

Been pushed over to the new outlook app from hotmail yesterday. I the issue im having is that it wont connect and download/recieve/notify me of any emails if im on mobile internet. If i connect to my Wi-fi at home, within seconds they all come flooding in.
It does nothing if i try and refresh it either.

I have 3 "hotmail" accounts on the app, all of which worked fine when still using hotmail app.

Any help would be appreciated.

Android version4.1.2

Thank you.



.

forum.xda-developers.com

[General] Google voice text option gone


So I switched from sprint to verizon so i'm assuming it has something to do with that. I noticed that I no longer got text messages on my google voice app on my phone or on the google voice site. My ability to send text messages on the app is gone, and the text button on the main site disappeared. I just have google lite so I just use them as my voicemail mostly, I've been trying to google to figure it out but can't find anything, thanks for any help.



.

forum.xda-developers.com

[General] delete unwanted pictures


Hi..i want to delete some files from my android phone gallery but m not getting the option of delete...the only options i get wen i open the album or any pic frm that album are Share,Select all,Deselect all and details...tats it but no option of delete..i went to manage apps in the settings and hit the clear data option there...its says that the data will be permanently deleted...i took the risk just to delete those unwanted pictures...but after that when i opened my gallery to check in...i found all the albums just the one i wanted to delete...i thot finally...shuuu!! but after sometime they came back...now even the idea is buggin me bad...what shud i do to JUST GET RID OF THE PICS I DONT WANT? please help me?



.

forum.xda-developers.com

[android help] View.getDrawingCache() with background for semi-transparent view

android - View.getDrawingCache() with background for semi-transparent view - 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.

















Is it possible to get the drawing cache with the views behind the view? For example, I have a semi-transparent view and I can see views behind it. So, can I get the drawing cache of this view with the behind views visible?
















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










default






.

stackoverflow.comm

[android help] How do I write to localStorage from Java on Android

How do I write to localStorage from Java on Android - 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 looking into the http://developer.android.com/reference/android/webkit/WebStorage.html API but it does not support writing to localStorage from Java. What I would like to do is to store data from the Java side of an android application to be read by the JavaScript side of the app.


For instance, in JavaScript I can use localStorage.getItem(), localStorage.setItem(). However, I cannot find similar API to accomplish the task from Java. Is there a workaround or it has not been implemented by the Android platform yet?


Any help would be appreciated!


























There are many ways to store data in an Android application, as detailed in the Storage Options guide:




















default






.

stackoverflow.comm

[android help] NoClassDefFound exception when using dialog fragment


I'm new to android development. I'm following this link to create an alert dialog. But I'm receiving NoClassDefFound error at


newFragment.show(getFragmentManager(), "dialog");


EDIT: Stacktrace



04-19 06:40:08.640: E/AndroidRuntime(1656): FATAL EXCEPTION: main 04-19 06:40:08.640: E/AndroidRuntime(1656): java.lang.NoClassDefFoundError: org.poovelil.gpstest.MainActivity$MyAlertDialogFragment 04-19 06:40:08.640: E/AndroidRuntime(1656): at org.poovelil.gpstest.MainActivity.onCreate(MainActivity.java:37) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.ActivityThread.access$1500(ActivityThread.java:135) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.os.Handler.dispatchMessage(Handler.java:99) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.os.Looper.loop(Looper.java:150) 04-19 06:40:08.640: E/AndroidRuntime(1656): at android.app.ActivityThread.main(ActivityThread.java:4389) 04-19 06:40:08.640: E/AndroidRuntime(1656): at java.lang.reflect.Method.invokeNative(Native Method) 04-19 06:40:08.640: E/AndroidRuntime(1656): at java.lang.reflect.Method.invoke(Method.java:507) 04-19 06:40:08.640: E/AndroidRuntime(1656): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849) 04-19 06:40:08.640: E/AndroidRuntime(1656): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607) 04-19 06:40:08.640: E/AndroidRuntime(1656): at dalvik.system.NativeStart.main(Native Method)



My Code is below.



public class MainActivity extends Activity {

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

LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
boolean gpsOn = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean networkOn = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if(!gpsOn) {
Toast.makeText(getApplicationContext(), "GPS Provider is off", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), "GPS Provider is on", Toast.LENGTH_SHORT).show();
}

if(!networkOn) {
Toast.makeText(getApplicationContext(), "Network provider is off", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), "Network provider is on", Toast.LENGTH_LONG).show();
}

if(!networkOn || !gpsOn) {
DialogFragment newFragment = MyAlertDialogFragment.newInstance(1);
newFragment.show(getFragmentManager(), "dialog");
//startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

public static class MyAlertDialogFragment extends DialogFragment {

public static MyAlertDialogFragment newInstance(int title) {
MyAlertDialogFragment frag = new MyAlertDialogFragment();
Bundle args = new Bundle();
args.putInt("title", title);
frag.setArguments(args);
return frag;
}

public Dialog onCreateDialog(Bundle savedInstanceState) {
int title = getArguments().getInt("title");


return new AlertDialog.Builder(getActivity())
//.setIcon(R.drawable.alert_dialog_icon)
.setTitle(title)
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface arg0, int arg1) {
//((FragmentAlertDialog) getActivity()).doPositiveClick();

}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface arg0, int arg1) {


}
})
.create();
}
}


.

stackoverflow.comm

[android help] How do I make a Telnet connection to an Android device?


I want to be able to make telnet calls to an Android device, for giving it a geo location similar to this answer in "How to emulate GPS location in the Android Emulator?".


I tried using the Net::Telnet class in Ruby, and this code does seem to be doing it:



require 'net/telnet'
telnet = Net::Telnet::new( "Host" => "localhost",
"Port" => 5554,
"Timeout" => 90 )
telnet.puts("geo fix -122.326 47.633")


I am not receiving any errors but the app doesn't get the location.


When I am running this in terminal I do not close the session, so how do I do to the same through Ruby?



.

stackoverflow.comm

[android help] Android: uses-library in AndroidManifest

Android: uses-library in AndroidManifest - 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.

















This might be a dumb question but could somebody help me understand in what case we will have to add uses-library in AndroidManifest.xml rather than just adding the jar to the project?


Thanks.
















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










default






.

stackoverflow.comm

[android help] Saving Intent to a File


I am finding a way to save/load Intents on a File to store my application settings.


Now I created some functions such as :


public boolean writeFileToSDCard(String datapack, String path) { ... }


To save String to a file, but I believe there is a better way to save a data structure like Intent.


Is there any simple example to get an idea for it?


Thanks very much for your help all the time.



.

stackoverflow.comm

[General] Battery Disconnected warning with Hyperion Battery


I just got a larger Hyperion battery with a replacement, also larger, back case.
Whenever I put it on the charger, my phone says "Battery Disconnected".
Does this make any sense? I'd really like a larger battery, but this is kind of an kink in my plans.



.

forum.xda-developers.com

[android help] how to move a view from viewgroup into another viewgroup?

android - how to move a view from viewgroup into another viewgroup? - 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.


















android:id="@+id/linear1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF4D00"
android:orientation="vertical" >

android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button" />


android:id="@+id/linear2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF4D00"
android:orientation="vertical" >



I wanna move the @button1 into @linear2, and the attributes belong button1 can't lost, include click lisener. then, the @linear1 is gonna be empty. like cut operation. How can I do?
















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










default







.

stackoverflow.comm

[General] Galaxy S2X: Device not responding


Hi there,

Whenever I go to plug my phone into my computer to connect to Kies, a message comes up saying: "Notification: Device not responding". I have a Samsung Galaxy S2X and am connecting to a Macbook. Does anyone know of any solutions to this problem?

Many thanks.



.

forum.xda-developers.com

[android help] How to kill a PostDelayed Method in Android


I used postedDelayed method to refresh my Activity, which works fine. But the problem is that even when I press the Back button postdelayed method call back the previous activity..


//handler for 30000 milli-secs post delay refreshment of the activity



mHandler.postDelayed(new Runnable() {
public void run() {
dostuff();

}
}, 30000);
}

protected void dostuff() {
Intent intent = getIntent();
finish();startActivity(intent);
Toast.makeText(getApplicationContext(), "refreshed", Toast.LENGTH_LONG).show();
}

public void onBackPressed() {
super.onBackPressed();
finish();
mHandler.removeCallbacks(null);
}

protected void onStop() {
mHandler.removeCallbacks(null);
super.onStop();
}


.

stackoverflow.comm

[General] Email Contacts?


Just order my first Android device my main concern is about getting my Email contacts over to my new device. So when you start adding Email accounts like Live or Hotmail or Yahoo for example once you add those Email accounts will it pull in my contacts that go along with my Email Accounts?



.

forum.xda-developers.com

[General] cannot install apps on google play


Hello
When I try to install any app from Google play store it all goes well until I press the 'accept and download' button and the app just goes back to main screen and the app is not installed. I am using Samsung Galaxy S3.
I cleared the data of google play yesterday because I was getting these annoying messages which slowed my phone down (they were popping up every 2 seconds or so)
Please do you have any suggestions?
Thank you



.

forum.xda-developers.com

[android help] Why CamcorderProfiles doesn't define the whole quality in android source code?


As we know , android provide the CamcorderProfile class in frameworks/base/media/java/android/media/CamcorderProfiles.java and the quality levels.


The following data is from android SDK.


  1. int QUALITY_1080P Quality level corresponding to the 1080p (1920 x 1080) resolution.

  2. int QUALITY_480P Quality level corresponding to the 480p (720 x 480) resolution.

  3. int QUALITY_720P Quality level corresponding to the 720p (1280 x 720) resolution.

  4. int QUALITY_CIF Quality level corresponding to the cif (352 x 288) resolution.

  5. int QUALITY_HIGH Quality level corresponding to the highest available resolution.

  6. int QUALITY_LOW Quality level corresponding to the lowest available resolution.

  7. int QUALITY_QCIF Quality level corresponding to the qcif (176 x 144) resolution.

  8. int QUALITY_QVGA Quality level corresponding to the QVGA (320x240) resolution.

There are eight levels.


The definition of the levels is in frameworks/av/media/libmedia/MediaProfiles.cpp . But I can only find little implemetion about createDefaultCamcorder action.


Such as:


/static/ MediaProfiles::CamcorderProfile* MediaProfiles::createDefaultCamcorderQcifProfile(camcorder_quality quality){}


/static/ MediaProfiles::CamcorderProfile* MediaProfiles::createDefaultCamcorderCifProfile(camcorder_quality quality){}


There are only two levels . So I want to know , why google don't implement the whole 8 levels? Or I had missed something ?


I am using Android 4.1.


Thanks.



.

stackoverflow.comm

[android help] Using the android Google Maps API v2 as a viewer of offline tiles: is it possible?


The Google map component (com.google.android.gms.maps.GoogleMap) allows one to render custom tiles (OpenStreetMap or other). These tiles can be on the device and available offline which is what I am doing by extending TileProvider. Doing this in conjunction with a:



mMap.setMapType(GoogleMap.MAP_TYPE_NONE);


I am not pulling any data from Google map servers and the component can reasonably be expected to work without an internet connection. (I emphasize here that I am not trying to cache Google's data; I am working with offline tiles independently of Google's map servers.)


I thought everything was fine until I realized that the map component won't work if, when it is executed for the first time, the device is offline. In such cases I get a message:



failed to load map. could not contact google servers



I imagine the reason behind this is Google's API keys which require my app to authenticate in order for the component to be allowed to execute.


Can anyone confirm this is correct? What I would really like to be sure of is that provided that the component is executed once online, it will run ok afterwards. I must make sure that there are no time-out issues which would require the component to re-authenticate later on and which would basically make my app useless. That would require that I move on to some other component (such as OS Android).


Any light on this would be greatly appreciated. Even being pointed to the channel through which I could hope to get a reply from the google developers would be useful.


Thanks



.

stackoverflow.comm

[android help] Multi User Chat in Android

Multi User Chat in Android - 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.

















Does any body have implemented multi user chat in android application? I want to create a private room which will add members by invitation and let the members chat. any one have any idea to implement this using XMPP and asmack in android?
















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










default







.

stackoverflow.comm

[General] Posting on some threads


We have tools built into the forums that try and auto-detect spam. It isn't perfect and sometimes requires posts to be approved that aren't actually spam. Certain keywords and phrases trigger it. If it happens again, just sit tight, someone will approve it soon.



.

forum.xda-developers.com

[android help] asynctask not getting arraylist when called from a handler


I'm using a handler to start an asynctask but when doing so, my application crashes. The reason I am stuck is because if I start the asynctask via anything else (eg. onClickListener) then I can run it as many times, over and over again, and it works perfect every single time. As soon as I execute the asynctask from my handler, it immediately crashes the application with a NullPointerException.


My handler looks something like this



public Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
handler.post(new Runnable() {
@Override
public void run() {
new sortNearby().execute();
}

});
}
};


Here is part of the stack trace from the application showing the exception



Caused by: java.lang.NullPointerException
at badams.android.app.fragments.MainMenu_NearbyFragment$sortNearby.doInBackground(MainMenu_NearbyFragment.java:100)


Line 100 of my code is the first line in the asynctask under doInBackground



protected String doInBackground(String... args) {
for (int i = 0; i < global.places.size(); i++) { //this is line 100


I understand that the exception is more than likely coming from "global.places.size()" probably being null, but I am stuck on why its doing that only when called from the handler, as it works fine if I start the task from any other section of my code.


EDIT


As requested by @Raghunandan, here is the entire code block from doInBackground in my asynctask, which calculates the distance between a "place" and the user:



protected String doInBackground(String... args) {
for (int i = 0; i < global.places.size(); i++) { //THIS IS LINE 100
Location locationA = new Location("place");
locationA.setLatitude(global.places.get(i).getLatitude());
locationA.setLongitude(global.places.get(i).getLongitude());
Location locationB = new Location("user");
locationB.setLatitude(global.applicationLocationManager.getLatitude());
locationB.setLongitude(global.applicationLocationManager.getLongitude());
float dist = locationA.distanceTo(locationB);
dist = dist / 1000;
global.places.get(i).setDistance(dist);
publishProgress(global.places.get(i));
}
return null;
}


.

stackoverflow.comm

[android help] Layout: background picture streched


I have difficulties with my layout.


As my first dev project, I'm trying to make a simple chronometer. I want to have a picture of a chronometer in the background and the start and stop button at the bottom of the application, side by side and filling the width of the screen.


Here is my best shot, but I'm not satisfied.


All widgets are placed properly but ... My background is streched and my buttons seem vertically compressed, even the text at the bottom is a bit cropped.


I found that if I change these lines



android:layout_width="fill_parent"
android:layout_height="fill_parent"


by



android:layout_width="wrap_content"
android:layout_height="wrap_content"


The background is ok, the buttons too .. but all widgets are placed in the center of the Activity.


How can I fix this ?


By the way if I want to have my buttons side by side, did I choose the better solution ?


Thanks for your help ! Charles.


... and now my xml ....



xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/background"
tools:context=".Chronosv1" >

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_weight="2" >

android:id="@+id/chronometer1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" />



android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >

android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="START" />

android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="STOP" />



.

stackoverflow.comm

[android help] How to catch "after all view added" in ListView with CursorAdapter?


I need to do some action with Views, wich depends on View size. That while I must to do this action after all Views added in ListView. What is the best way to implement this?



.

stackoverflow.comm

[android help] Disable SDCard Access

android - Disable SDCard Access - 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 have a requirement where i need to block the user from having access to the device (phone) SDCard more like disable the SDCard completely. Is there a way i can achieve this? Can someone kindly guide me with some inputs on this.





























You can safely remove the sdcard, I think your requirement is same:



Intent i = new Intent(android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS);
startActivity(i);


Unmounting the SD card is one of those actions which could be used maliciously if it wasn't under full user control. If it could be done purely in software (without user intervention) then code could disrupt other apps running on the device.























You can't unmount SD Card from running device according to you the best answer on this: (re)mounting the SD card on android emulator






















do you want your emulator to stop using SD -Card or phone.






















For what purpose you need to disable? To protect your application?If so, you can monitor by


using File observer. Do some stuffs like,If your application moves to particular path use



file.delete();






















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