Thursday, June 27, 2013

[General] Can I use my old Droid Bionic as on a straight talk plan?


Can I use my old Droid Bionic as on a straight talk plan?



I just bought a Samsung Galaxy S4, which I love, but anyway I was wondering could my girlfriend take my Bionic and use it on a straight talk plan? I am either going to buy her a good straight talk phone or let her use my Bionic, but I'd much rather save the $ and use the Bionic if I could especially considering it's going to be a better phone anyway for her. If it's possible to do this what are the necessary steps?



.

forum.xda-developers.com



[General] SD Card damaged on the Galaxy S2, Help?


SD Card damaged on the Galaxy S2, Help?



Okay so pardon me for my bad grammar but here's what i did

I used Notpod to transfer music into my Galaxy S2 in the SD Card file but after I disconnected there was a notification saying "Media Scanner Running" And after it finished scanning it gave me a notification that the SD Card have been damaged, try reformatting. I formatted the SD card and proceed to redo the whole thing again only to get the same messaged. I've restarted my phone, I've took the SD card out and put it back in but nothing seems to work.

Any suggestions?



.

forum.xda-developers.com



[General] Retrieve deleted pictures?


Retrieve deleted pictures?



I accidentally deleted all of the pictures I had taken on my droid razr maxx. I thought I was deleting one picture, but it was the entire album!! Is there anything I can do retrieve them? No, I had not backed up any of them to assistant!



.

forum.xda-developers.com



[General] I Have 2 Questions: iSMS2droid & Clean Master


I Have 2 Questions: iSMS2droid & Clean Master



Im new to the Androis market. Ive just merged all my iphone sms to my Galaxy Note 2 using iSMS2droid. Is it now okay for me to uninstall both of the apps (SMS Backup & Restore aswell) ?

Also am I better off using Clean Master to uninstall apps or using Application Manager?

Thanka a lot.



.

forum.xda-developers.com



[General] LiveSuit stops stays at 0%


LiveSuit stops stays at 0%



I have tried to flash a rom using LiveSuit (1.07 and 1.09) but, although it seems to start correctly, displaying '3 mins to go and 3% complete, it then reverts back to 0% and remains stubbornly at 0% even an hour or more later. Is there anything I can do to cure this? The device manager in Windows shows the device with a yellow exclamation mark and when I try to update the driver it just says the driver is already up to date.



.

forum.xda-developers.com



[General] stock recovery image for karbonn a4+


stock recovery image for karbonn a4+



I accidentally flashed the wrong recovery image on my karbonn a4+ using mobileuncle tools . The phone is stuck in recovery mode and I am unable to make a selection in recovery. How can I flash the correct version of stock recovery. i cant factory reset in my phone. plz give a solution ......



.

forum.xda-developers.com



[android help] How to get message field in a rich push notification


How to get message field in a rich push notification



I'm developing an application with a notification inbox using Urban Airship.


A rich push notification contains title and message. It's sent as a JSONObject, i.e.:



{"aliases": ["user@mail.com"], "push": {"aps": {"alert": "ei!"}}, "title": "New notification", "message": "This is a rich push test!"}



When I get my inbox and I try to open a RichPushMessage, I only can get title and send date. There isn't a method to get the JSONObject (UrbanAirship API)


How I could retrieve the message field? I've seen about "RichPushMessageView" component, but I don't like to show the notification as a webpage. I only need the message field and show it in a textview.



.

stackoverflow.comm



[android help] TileProvider using local tiles


TileProvider using local tiles




  1. You can put tiles into assets folder (if it is acceptable for the app size) or download them all on first start and put them into device storage (SD card).




  2. You can implement TileProvider like this:





public class CustomMapTileProvider implements TileProvider {
private static final int TILE_WIDTH = 256;
private static final int TILE_HEIGHT = 256;
private static final int BUFFER_SIZE = 16 * 1024;

private AssetManager mAssets;

public CustomMapTileProvider(AssetManager assets) {
mAssets = assets;
}

@Override
public Tile getTile(int x, int y, int zoom) {
byte[] image = readTileImage(x, y, zoom);
return image == null ? null : new Tile(TILE_WIDTH, TILE_HEIGHT, image);
}

private byte[] readTileImage(int x, int y, int zoom) {
InputStream in = null;
ByteArrayOutputStream buffer = null;

try {
in = mAssets.open(getTileFilename(x, y, zoom));
buffer = new ByteArrayOutputStream();

int nRead;
byte[] data = new byte[BUFFER_SIZE];

while ((nRead = in.read(data, 0, BUFFER_SIZE)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();

return buffer.toByteArray();
} catch (IOException e) {
e.printStackTrace();
return null;
} catch (OutOfMemoryError e) {
e.printStackTrace();
return null;
} finally {
if (in != null) try { in.close(); } catch (Exception ignored) {}
if (buffer != null) try { buffer.close(); } catch (Exception ignored) {}
}
}

private String getTileFilename(int x, int y, int zoom) {
return "map/" + zoom + '/' + x + '/' + y + ".png";
}
}


And now you can use it with your GoogleMap instance:



private void setUpMap() {
mMap.setMapType(GoogleMap.MAP_TYPE_NONE);

mMap.addTileOverlay(new TileOverlayOptions().tileProvider(new CustomMapTileProvider(getResources().getAssets())));

CameraUpdate upd = CameraUpdateFactory.newLatLngZoom(new LatLng(LAT, LON), ZOOM);
mMap.moveCamera(upd);
}


In my case I also had a problem with y coordinate of tiles generated by MapTiler, but I managed it by adding this method into CustomMapTileProvider:



/**
* Fixing tile's y index (reversing order)
*/
private int fixYCoordinate(int y, int zoom) {
int size = 1 << zoom; // size = 2^zoom
return size - 1 - y;
}


and callig it from getTile() method like this:



@Override
public Tile getTile(int x, int y, int zoom) {
y = fixYCoordinate(y, zoom);
...
}


[Upd]


If you know exac area of your custom map, you should return NO_TILE for missing tiles from getTile(...) method.


This is how I did it:



private static final SparseArray TILE_ZOOMS = new SparseArray() {{
put(8, new Rect(135, 180, 135, 181 ));
put(9, new Rect(270, 361, 271, 363 ));
put(10, new Rect(541, 723, 543, 726 ));
put(11, new Rect(1082, 1447, 1086, 1452));
put(12, new Rect(2165, 2894, 2172, 2905));
put(13, new Rect(4330, 5789, 4345, 5810));
put(14, new Rect(8661, 11578, 8691, 11621));
}};

@Override
public Tile getTile(int x, int y, int zoom) {
y = fixYCoordinate(y, zoom);

if (hasTile(x, y, zoom)) {
byte[] image = readTileImage(x, y, zoom);
return image == null ? null : new Tile(TILE_WIDTH, TILE_HEIGHT, image);
} else {
return NO_TILE;
}
}

private boolean hasTile(int x, int y, int zoom) {
Rect b = TILE_ZOOMS.get(zoom);
return b == null ? false : (b.left <= x && x <= b.right && b.top <= y && y <= b.bottom);
}


.

stackoverflow.comm



[android help] Android Emulator for windows?(Not to install the Complete SDK, Just Emulator Needed)


Android Emulator for windows?(Not to install the Complete SDK, Just Emulator Needed)



Is there any possible way to install Android Emulator itself on the windows. I would need that for the Testing purpose? Any Idea?


Please Note: I dont want to install whole sdk. i just want install the Emulater itself. that emulator is just like that a phone for the testing purpose.


Thanks in Advance



.

stackoverflow.comm



[android help] Unable to instantiate fragment make sure class name exists, is public, and has an empty constructor that is public


Unable to instantiate fragment make sure class name exists, is public, and has an empty constructor that is public



I am using the Fragment and When I change the orientation of the device. If initially its portrait and when i change it to landscape then my application crash. I added the logcat here. I have gone through many links but could not find the right answer.


Please help me to solve this issue.


Thanks



public class PageViewActivity extends FragmentActivity {

private ViewPager viewPager;
private NoticePageAdapter noticePageAdapter;
private TextView titleText;
private int pageIndex;
private static int restTime = 0;
private long lastTime;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_page_view);

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title2);
titleText = (TextView) findViewById(R.id.title2);
titleText.setText(R.string.app_name);

// Create the adapter that will return a fragment for each of the three
// primary sections of the app.
noticePageAdapter = new NoticePageAdapter(getSupportFragmentManager());

// Set up the ViewPager with the sections adapter.
viewPager = (ViewPager) findViewById(R.id.viewpager);
Intent intent = getIntent();
pageIndex = intent.getIntExtra("notice_position", 0);
viewPager.setAdapter(noticePageAdapter);
viewPager.setCurrentItem(pageIndex, true);

lastTime = System.currentTimeMillis();

//Check the rest time. If it exceed the 30 sec then finish the activity.
new CheckTimeThread().start();
}

/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
class NoticePageAdapter extends FragmentPagerAdapter {

public NoticePageAdapter(FragmentManager fm) {
super(fm);
}

@Override
public Fragment getItem(int position) {
Fragment fragment = new NoticeFragment();
Bundle args = new Bundle();
args.putInt(NoticeFragment.TEMPLATE_POSITION, position + 1);
fragment.setArguments(args);
return fragment;
}

@Override
public int getCount() {
return NoticeData.templateId.length;
}
}

/**
* A Notice fragment representing a notices of the app, but that simply
* displays notices
*/
public class NoticeFragment extends Fragment {
public static final String TEMPLATE_POSITION = "template_position";
private TextView noticeHeaderTextView;
private TextView noticeContentTextView;
private ImageView noticeImageView;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
int templatePosition = getArguments().getInt(TEMPLATE_POSITION);
int templateId = 0;
int tempVar;

tempVar = templatePosition - 1;
templateId = Integer.parseInt(NoticeData.templateId[tempVar]);

int res = R.layout.first_template;

switch (templateId) {
case 1:
res = R.layout.first_template;
break;
case 2:
res = R.layout.second_template;
break;
case 3:
res = R.layout.third_template;
break;
case 4:
res = R.layout.fourth_template;
break;
default:
break;
}

View rootView = inflater.inflate(res, container, false);
noticeHeaderTextView = (TextView)rootView.findViewById(R.id.noticeHeading);
noticeHeaderTextView.setText(Html.fromHtml(NoticeData.noticeHeading[tempVar]));

noticeContentTextView = (TextView)rootView.findViewById(R.id.noticeContent);
noticeContentTextView.setText(Html.fromHtml(NoticeData.noticeContent[tempVar]));

noticeImageView = (ImageView)rootView.findViewById(R.id.noticeImageView);
UrlImageViewHelper.setUrlDrawable(noticeImageView, NoticeData.imagesURL[tempVar]);

DisplayMetrics metrics = getResources().getDisplayMetrics();
int width = metrics.widthPixels;

if(templateId == 3) {
noticeImageView.getLayoutParams().width = width / 2;
}
else if(templateId == 2) {
noticeHeaderTextView.getLayoutParams().width = width/2;
noticeContentTextView.getLayoutParams().width = width/2;
}

RelativeLayout relativeLayout = (RelativeLayout)rootView.findViewById(R.id.relativeLayout);
relativeLayout.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
resetRestTime();
return false;
}
});

return rootView;
}
}
}


Error Trace:



06-24 18:24:36.501: E/AndroidRuntime(11863): FATAL EXCEPTION: main
06-24 18:24:36.501: E/AndroidRuntime(11863): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.noticeboard/com.noticeboard.PageViewActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.noticeboard.PageViewActivity$NoticeFragment: make sure class name exists, is public, and has an empty constructor that is public
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3365)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.access$700(ActivityThread.java:128)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1165)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.os.Handler.dispatchMessage(Handler.java:99)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.os.Looper.loop(Looper.java:137)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.main(ActivityThread.java:4514)
06-24 18:24:36.501: E/AndroidRuntime(11863): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:24:36.501: E/AndroidRuntime(11863): at java.lang.reflect.Method.invoke(Method.java:511)
06-24 18:24:36.501: E/AndroidRuntime(11863): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
06-24 18:24:36.501: E/AndroidRuntime(11863): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
06-24 18:24:36.501: E/AndroidRuntime(11863): at dalvik.system.NativeStart.main(Native Method)
06-24 18:24:36.501: E/AndroidRuntime(11863): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.noticeboard.PageViewActivity$NoticeFragment: make sure class name exists, is public, and has an empty constructor that is public
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.support.v4.app.Fragment.instantiate(Fragment.java:399)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.support.v4.app.FragmentState.instantiate(Fragment.java:97)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1760)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:200)
06-24 18:24:36.501: E/AndroidRuntime(11863): at com.noticeboard.PageViewActivity.onCreate(PageViewActivity.java:40)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.Activity.performCreate(Activity.java:4465)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
06-24 18:24:36.501: E/AndroidRuntime(11863): ... 12 more
06-24 18:24:36.501: E/AndroidRuntime(11863): Caused by: java.lang.InstantiationException: can't instantiate class com.noticeboard.PageViewActivity$NoticeFragment; no empty constructor
06-24 18:24:36.501: E/AndroidRuntime(11863): at java.lang.Class.newInstanceImpl(Native Method)
06-24 18:24:36.501: E/AndroidRuntime(11863): at java.lang.Class.newInstance(Class.java:1319)
06-24 18:24:36.501: E/AndroidRuntime(11863): at android.support.v4.app.Fragment.instantiate(Fragment.java:388)
06-24 18:24:36.501: E/AndroidRuntime(11863): ... 19 more


.

stackoverflow.comm



[android help] how to use android geofencing api?


how to use android geofencing api?



who may concern,


i tested new google play service api.


That is geofencing. i downloaded the sample code from android developers site(http://developer.android.com/shareables/training/GeofenceDetection.zip).


i ran this code on android device(galaxy note2).


i placed my office geo-position and radius to 10m.


when i was walking to my office, nothing happened.


while running the sample code, one thing i have noticed is when I am already placed inside the geofence range and add the geofence to LocationClient at the moment.


so i read LocationClient class document(http://developer.android.com/reference/com/google/android/gms/location/LocationClient.html#addGeofences(java.util.List, android.app.PendingIntent, com.google.android.gms.location.LocationClient.OnAddGeofencesResultListener)).


i found the following paragraph.


"In case network location provider is disabled by the user, the geofence service will stop updating, all registered geofences will be removed and an intent is generated by the provided pending intent. In this case,hasError(Intent) returns true and getErrorCode(Intent) returns GEOFENCE_NOT_AVAILABLE."


so i turned on wi-fi. and was walking to my office(geofence), then i got notification "geofence entered".


i have some question.



  1. does geofencing only work with wi-fi?




  2. why not happened in 3g network?




  3. is that a sample code bug?




  4. is that my mistake?



I'm waiting for your urgent reply..


anyone help me..please.



.

stackoverflow.comm



[android help] How to restart an application completely?


How to restart an application completely?



I have an application which starts a Remote Service in its first launched activity. Then, in another activity, the user can set the configuration of the application. Please note that this second activity isn't bound to the Service and I don't wish to bind it.


Now my question is : how could I restart the whole application from the second activity, after changing the configuration settings?


For now, I am using a button which onClickListener is :



public void onClick(DialogInterface dialog, int which) {
sauvegarde();
Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}


The problem is : it only restarts the current activity without shutting the whole application, and therefore, without restarting the service


Any ideas?



.

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