Sunday, June 30, 2013

[General] VLC Player and Audio Problems


VLC Player and Audio Problems



Hi All,

I'm running the latest VLC Player from the Google play store. Nexus 10, 4.2.2, stock.

Anytime I watch a .mkv using VLC I get a "clipping" sound. It is absent when I use BS Player; however, I prefer to use VLC. Is there any solution or codec I need to install?

Thanks all.



.

forum.xda-developers.com



[General] Go locker fourkey theme - how to change icons?


Go locker fourkey theme - how to change icons?



I am using Go Launcher Ex and Go Locker. My lock screen theme is Fourkey. The four default choices are home screen, SMS, Phone, and Camera. I read somewhere that you can customize these icons? Is that possible? If so, how do I do that? I want to replace the Camera icon with my AquaMail icon.

Thanks.



.

forum.xda-developers.com



[General] New music isn't showing in Library? Galaxy S4 issue


New music isn't showing in Library? Galaxy S4 issue



I have had the Droid 1 and 3 by Motorola, and when I used to add music it was simple, i'd throw it into USB mode, drag & drop music, open music player...it'd see the new tracks, and boom good to go. This is the first time I have tried to update to my GS 4 and all I get is "Connecting to Samsung account services" over and over...why the hell do they make easy things harder with better devices, I don't care about my stuff on the cloud or backed up anywhere, I want to access music off an sd card, plain and simple, it will play my previous stuff that was on the card, how do I get this damn thing to see my new music?

Sorry - frustrated



.

forum.xda-developers.com



[General] Huawei Smartphones to Experience Emotion UI


Huawei Smartphones to Experience Emotion UI



It may be the world's
Most emotional system

"Emotion UI is a Huawei developed, Android based man-machine interaction system for smart terminals. With Emotion UI, everything is easy to find, easy to enjoy, and easy to share. You can enjoy the vivid display and have fun customizing your phone. Customizable Home screens, applications, and easy switching between themes. "

> Uni Home
> Profile Switcher
> Smart Tutorial
> Customizable UI
Many More Features with Emotion UI.

The Popular Smartphones like Ascend P1, Honor u8860, Honor 2 upcoming Ascend P6 are now experiencing the advanced EMUI Features and Updates.



.

forum.xda-developers.com



[General] Too much ram being used? Help


Too much ram being used? Help



This isn't a problem the way most people intuitively think about it. For efficiency, you actually want to be using a steady stream of most of your RAM when it's needed, rather than spiking up and down, etc. This efficiency helps lead to a smoother transition between actions than would be observed with a start/stop fluctuation pattern. In general, unless you have a rogue app that is out of control, you don't want to arbitrarily start killing apps. Android will handle this in the background for you on an as needed basis.



.

forum.xda-developers.com



[General] help me. how to. check which folder is created by which app


help me. how to. check which folder is created by which app


Copyright 2013 Mobile Nations ● Terms and ConditionsPrivacy Policy

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. AndroidCentral is an independent site that is not affiliated with or endorsed by Google.



.

forum.xda-developers.com



[android help] Sorting items from an array of arrays


Sorting items from an array of arrays



I have a multidimensional array of dates, strictly an ArrayList>. I need to generate a new single-dimensional ArrayList made up of the items in all the arrays of the previously mentioned multidimensional one.


My first thought was to join all the arraylists together and sort them, but since I don't know the number of elements in each level, and only need a certain number of elements in the generated array, that would be a bit too much memory-and-processor-heavy. I mean, if I join all the Date elements in one ArrayList, I might end up with an arraylist of thousands of dates... to just eventually trim it to the first 20. That's why I dropped that solution.


So, which algorithm could I use to sort elements from N (or 2) levels into 1?



.

stackoverflow.comm



[android help] Open Image from Gallery Only in Potrait mode


Open Image from Gallery Only in Potrait mode



if you having an issue with the image rotation well i advice you to use this method as its the simplest and most efficient way.



String[] orientationColumn = { MediaStore.Images.Media.ORIENTATION };
@SuppressWarnings("deprecation")
Cursor cur = managedQuery(imageFileUri, orientationColumn, null,
null, null);
int orientation = -1;
if (cur != null && cur.moveToFirst()) {
orientation = cur.getInt(cur
.getColumnIndex(orientationColumn[0]));
}
Matrix matrix = new Matrix();
matrix.postRotate(orientation);
bmp = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(),
bmp.getHeight(), matrix, true);
view.setImageBitmap(bmp);


hope this is what you are looking for :)



.

stackoverflow.comm



[android help] Create a new costumer component for android


Create a new costumer component for android


Create a new costumer component for 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.

















Create calendar with customer view with displaying additional icons in the date field. I must also provide a calendar change themes and the ability to change the day, with kotorogto start the week (Monday / Wednesday). Please advise how to do it. Sorry for my English.



















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










default






.

stackoverflow.comm



[android help] how to set current time running continuesly with hours ,minutes ,seconds to textview in android?


how to set current time running continuesly with hours ,minutes ,seconds to textview in android?


how to set the current time running continuously with hours ,minutes ,seconds to textview 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.

















Actually by the time my Activity starts i should display current time in hours ,minutes,seconds(HH:mm:ss) in 24 hours format, and this time should run continuously as seconds need to change continuously gradually minutes and hours also. I kept a stop button in activity. once stop is clicked the time should stop and that stopped time need to be saved in a string .





























Try like this.. onClick of STOP Button



String currentTimeString = new SimpleDateFormat("HH:mm:ss").format(new Date());


Use this string in Toast or TextView or whatever depending on your requirement


To get Watch like display refer here























Try this code..



Date date =new Date();
DateFormat format = SimpleDateFormat.getTimeInstance
( SimpleDateFormat.MEDIUM, Locale.getDefault());

// set the text of component TextView with id 'message'
textView.setTextViewText(R.id.widget_textview,"Current Time "+ format.format(date));



















default






.

stackoverflow.comm



[android help] How do I import android licensing into eclipse?


How do I import android licensing into eclipse?



I found a question about it:


After this I found out that the package called "Google Play Licensing Library" and not "Google Market..". I saw that its already installed.


I also find a guide that should explain how to add lvl like library project: http://developer.android.com/google/play/licensing/setting-up.html#download-lvl


But I could do it. I tried to look for the files in the extra directory also with no luck...


What should I do?



.

stackoverflow.comm



[android help] MediaPlayer(16454): Unable to to create media player


MediaPlayer(16454): Unable to to create media player


android - MediaPlayer(16454): Unable to to create media player - 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 got this error:



06-28 09:32:24.266: E/MediaPlayer(16454): Unable to to create media player
06-28 09:32:24.338: W/VideoView(16454): Unable to open content: /data/data/com.laroche/cache/intro.mp4
06-28 09:32:24.338: W/VideoView(16454): java.io.IOException: setDataSourceFD failed.: status=0x80000000
06-28 09:32:24.338: W/VideoView(16454): at android.media.MediaPlayer.setDataSource(Native Method)
06-28 09:32:24.338: W/VideoView(16454): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:976)
06-28 09:32:24.338: W/VideoView(16454): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:955)
06-28 09:32:24.338: W/VideoView(16454): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:918)
06-28 09:32:24.338: W/VideoView(16454): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:870)
06-28 09:32:24.338: W/VideoView(16454): at android.widget.VideoView.openVideo(VideoView.java:236)
06-28 09:32:24.338: W/VideoView(16454): at android.widget.VideoView.access$2000(VideoView.java:52)
06-28 09:32:24.338: W/VideoView(16454): at android.widget.VideoView$6.surfaceCreated(VideoView.java:490)


when using the following code :



String cacheDir = getApplicationContext().getCacheDir().getAbsolutePath();
Log.d("video path",cacheDir+"/intro.mp4");
vvIntro.setVideoPath(cacheDir+"/intro.mp4");
vvIntro.start();


I want to play a video stored in cache folder


























First check your file permission. And try without the .mp4 extension if there is no other file on the same name otherwise try with a .3gp file similarly without extension.























Maybe MediaPlayer requires MODE_WORLD_READABLE for your Intro file. Try to save it in none PRIVE mode.


Or you forgot to add permission for READING internal storage.























default






.

stackoverflow.comm



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



Wednesday, June 26, 2013

[General] App to turn another app on and off based on time


App to turn another app on and off based on time



Hi all...

I like to sleep at night! When I do I would love it if I could turn Google Talk off but have it switch on again in the morning without me having to remember to do it. At the moment I have an app which puts the phone into airplane mode and I set a time to turn it back on. If I could do the same with Google Talk it would be awesome.

Does anyone have any ideas of an app that would turn it off for a set period of time, or maybe at a certan time of the day check to see if it is off and start it up again?

Thanks guys.



.

forum.xda-developers.com

[General] can I back up but *not* restore using Backup and Restore?


can I back up but *not* restore using Backup and Restore?



Hi,

If I use the Backup and Restore option in my S3's settings, can I just back up my settings to Google and back out of the restore? I'm afraid to give it a try in case it goes from backup --> restore on it's own.

Thanks,
Deb



.

forum.xda-developers.com

[General] Downloading on 3g


Downloading on 3g



I have a question, hopefully i'll make sense and someone can help me

Say I want to download a tv programme onto my tablet but I'm not in a wifi hospot, so using 3g.

Let's the the programme is 350mb, does that mean that downloading on 3g would use up 350mb of my data allowance?



.

forum.xda-developers.com

[General] Unlock to last app used


Unlock to last app used



It should do that by default, however some system intensive apps like games and the like will restart when you unlock your phone.

The reason being that some apps don't work well with wake locks. And putting the phone to sleep during the middle of a system intensive app interrupts the process and forces it to close. Because turning the phone off causes the processor to sleep.

Sprint GS3 Running TN's Msg and Chubbs



.

forum.xda-developers.com

[General] Seeking App for Non-Cloud Email with Folders and Filters


Seeking App for Non-Cloud Email with Folders and Filters



Is there an Android email app that will do the following:


  • Sync with multiple POP3 accounts

  • Sort mail into folders automatically

  • One of the sort criteria: Sender is in my Contacts list

If not, would someone please write it?

(I can't switch to IMAP and I won't use Gmail or another cloud-based service.)


.

forum.xda-developers.com

[General] Looking for a good headset


Looking for a good headset



Is there a good monaural headset with a large leather earcup that can fit around the ear?

Sort of like this except with a leather earcup. Blutooth would be best, but wired is acceptable. Does not matter if earcup is closed or open, although closed would be best. The phone I will use it for will be either a Samsung Note II or S 4.



.

forum.xda-developers.com

[android help] Android: Image Over Zooming


Android: Image Over Zooming



I have this code from a tut that enables scrolling and zooming of an image, but even if the image is small, the code will stretch the image so that It will fill the whole screen. I want it to have a dialog maybe that contains the image and enables the zooming and scrolling by modifying the code without occupying the whole screen.


Edit: Is it possible to have a limit in scrolling or limit the size of the image using the code below?



public class ZoomHelloActivity extends Activity {

// Physical display width and height.
private static int displayWidth = 0;
private static int displayHeight = 0;


static String img="";

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

Display display = ((WindowManager)
getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
displayWidth = display.getWidth();
displayHeight = display.getHeight();

//get intent
Bundle extras = getIntent().getExtras();

if (extras != null) {
Toast.makeText(this.getBaseContext(),"Inside: "+img.toString(),
Toast.LENGTH_SHORT).show();
img = extras.getString("img");
// and get whatever type user account id is
}
else{ Toast.makeText(this.getBaseContext(),"ERROR ni",
Toast.LENGTH_SHORT).show();}
setContentView(new SampleView(this));


}

private static class SampleView extends View {
private static Bitmap bmLargeImage; //bitmap large enough to be scrolled
private static Rect displayRect = null; //rect we display to
private Rect scrollRect = null; //rect we scroll over our bitmap with
private int scrollRectX = 0; //current left location of scroll rect
private int scrollRectY = 0; //current top location of scroll rect
private float scrollByX = 0; //x amount to scroll by
private float scrollByY = 0; //y amount to scroll by
private float startX = 0; //track x from one ACTION_MOVE to the next
private float startY = 0; //track y from one ACTION_MOVE to the next

public SampleView(Context context) {
super(context);

// Destination rect for our main canvas draw. It never changes.
displayRect = new Rect(0, 0, displayWidth, displayHeight);
// Scroll rect: this will be used to 'scroll around' over the
// bitmap in memory. Initialize as above.
scrollRect = new Rect(0, 0, displayWidth, displayHeight);

// Load a large bitmap into an offscreen area of memory.
int assignImg;
assignImg = Integer.parseInt(img);
bmLargeImage = BitmapFactory.decodeResource(getResources(),
assignImg);
}

@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Remember our initial down event location.
startX = event.getRawX();
startY = event.getRawY();
break;

case MotionEvent.ACTION_MOVE:
float x = event.getRawX();
float y = event.getRawY();
// Calculate move update. This will happen many times
// during the course of a single movement gesture.
scrollByX = x - startX; //move update x increment
scrollByY = y - startY; //move update y increment
startX = x; //reset initial values to latest
startY = y;
invalidate(); //force a redraw
break;
}
return true; //done with this event so consume it
}

@Override
protected void onDraw(Canvas canvas) {
int newScrollRectX = scrollRectX - (int)scrollByX;
int newScrollRectY = scrollRectY - (int)scrollByY;

// Don't scroll off the left or right edges of the bitmap.
if (newScrollRectX < 0)
newScrollRectX = 0;
else if (newScrollRectX > (bmLargeImage.getWidth() - displayWidth))
newScrollRectX = (bmLargeImage.getWidth() - displayWidth);

// Don't scroll off the top or bottom edges of the bitmap.
if (newScrollRectY < 0)
newScrollRectY = 0;
else if (newScrollRectY > (bmLargeImage.getHeight() - displayHeight))
newScrollRectY = (bmLargeImage.getHeight() - displayHeight);

// We have our updated scroll rect coordinates, set them and draw.
scrollRect.set(newScrollRectX, newScrollRectY,
newScrollRectX + displayWidth, newScrollRectY + displayHeight);
Paint paint = new Paint();
canvas.drawBitmap(bmLargeImage, scrollRect, displayRect, paint);

// Reset current scroll coordinates to reflect the latest updates,
// so we can repeat this update process.
scrollRectX = newScrollRectX;
scrollRectY = newScrollRectY;
}
}
}


.

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