Saturday, November 30, 2013

Activate setting not showing during ActiveSync config [General]


Activate setting not showing during ActiveSync config



Hi all,

I have a phone where Im trying to configure ActiveSync. It all goes "smoothly" because the account can be configured. The problem is when I try to view email on the configured account. It says that security policies have to be updated but I dont know where to go. I tried to remove and add the account again but I never see the "Activate" prompt where Im supposed to accept the security policies. Therefore, I dont see the Email app as a device administrator as I do on all the other users I have configured their accounts for.

Thanks in advance!



Read more

forum.xda-developers.com



Widget for Official Twitter App Not Updating [General]


Widget for Official Twitter App Not Updating



i noticed the widget for the official twitter app does not update at startup unless i open the app. yes, sync data is on and sync interval is set. in addition, the phone was reset and reformatted with no avail. also installed it on another device with same results. even though the widget does not update, i still get dm, mention, favorite, and retweet notifcations. strange.

the facebook widget will always update at startup. i also use the seesmic widget which updates at startup. difference between facebook and seesmic is that seesmic has an option in the settings, "launch at startup" in "misc". after the device is turned on and completes loading up, the app does not open but starts running in the background. going back to facebook, it doesnt have an option like that. regardless, it starts running in background.

finally, the question. how do we get the twitter app to run in the background at startup so the widget can update?

btw, already tried 3 different startup manager apps but they open the twitter app at startup. it will get the widget to udpate because the app is now opened but thats not what im looking for.



Read more

forum.xda-developers.com



I need help asap! [General]


I need help asap!



I have a Samsung Galaxy S3, US Cellular SCH-R530. I recently switched from apple, and I was getting bad signal. My friend said that he would fix it, and he tried downgrading my phone from 4.3 Jelly Bean to 4.2 Jelly Bean. And now my phone is stuck in "Firmware upgrade encountered an issue. Please select recovery mode in Kies & try again. I use my phone daily, and for a lot of purposes. He said he didn't know how to fix it, and kind of left me hanging without a phone. SO I really need to know how to fix this. Please anyone help me!



Read more

forum.xda-developers.com



Return Nexus 4 to darker Holo theme post KitKat? Possible? [General]


Return Nexus 4 to darker Holo theme post KitKat? Possible?



Well, just got my Nexus 4 upgraded to KitKat and frankly the bright white backgrounds hurt the hell out of my eyes (I have bad eyes) especailly on the formerly nice and dark holo-themed Dialer app. Is there any way to get the lovely and easy to look at grey/black and blue holo theme back for the dialer? This new stark white nonsense that's been forced on me actually causes me physical pain. I know this won't be a problem for many, but I just want my dark theme back if anyone can point me in the right direction



Read more

forum.xda-developers.com



Friday, November 29, 2013

Phone-to-PC connection app [General]


Phone-to-PC connection app



Hi folks.

Big hands + small phone = need for a GOOD phone-to-PC connection app.

Phone is a Medion E4002 (bought from Aldi) running Android 4.1.1. Does everything I want and great value for money.

I've tried a few apps but so far not found anything that easily allows me to do all my phone editing on the PC screen – mainly extensive contacts editing, but also file transfer etc. Texting is a big one too, as I need to frequently send text messages to groups.

I want an app that loads when I want to use it, not when it thinks it's needed – some are really annoying in this respect.

I sit at my desk all day with phone beside me so connection will always be via USB cable. Don't care about other connection types (Bluetooth, etc).

Any suggestions?



Read more

forum.xda-developers.com



Get the length of video recorded so far (or get accurate start time) [android help]


Get the length of video recorded so far (or get accurate start time)


java - Get the length of video recorded so far (or get accurate start time) - 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 want to synchronize other sensor data with the video I'm recording, and so I'd like to record "how far am I into the video" when the sensor is triggered. Is there any way to do this? I couldn't find an appropriate method on the MediaRecorder class.


Another solution would be to just get the precise start time of the video recording, but my tests show that the video starts ~1sec after calling mediarecorder.start, but it's not consistent.


























You have raised an interesting topic.
If you refer to the documentation in the developer page, the following diagram states the recording is supposed to start when the start() method is called.


enter image description here
Your solution is supposed to be correct albeit there is a lag up to 1 sec. I would do it the same way
I went through the MediaRecorder class methods, the only method that seems to be useful is the callback setOnInfoListener().
Set it and see if you will get some kind of information when the recording starts! I haven't tried it yet though.




















lang-java






Read more

stackoverflow.comm



Gesture OnFling not called in ListView [android help]


Gesture OnFling not called in ListView



I need some help with handling the gestures on a listview. I have an videoview that I want to be able to detect left and right swipes on the layout below:


Link to a drawing of the current gesture and what is expected


The onFling method that i used to capture the event is not called



public class OnSwipeTouchListener implements OnTouchListener {

private final GestureDetector gestureDetector;
private FeedAdapter callback;

public OnSwipeTouchListener(Context context, FeedAdapter callback) {
gestureDetector = new GestureDetector(context, new GestureListener());
this.callback = callback;
}
@Override
public boolean onTouch(final View view, final MotionEvent motionEvent) {
return gestureDetector.onTouchEvent(motionEvent);
}

private final class GestureListener extends SimpleOnGestureListener {

private static final int SWIPE_THRESHOLD = 30;

@Override
public boolean onDown(MotionEvent e) {
return true;
}


public boolean onSingleTapUp(MotionEvent e) {
Log.v("Tom", "tap");
triggerTouch();
return true;
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
boolean result = false;
Log.v("Swipe","is called"); // this is not called when swipe is not perfectly straight
try {
float diffX = e2.getX() - e1.getX();
if (Math.abs(diffX) > SWIPE_THRESHOLD) {
if (diffX > 0) {
onSwipeRight();
} else {
onSwipeLeft();
}
}
} catch (Exception exception) {
exception.printStackTrace();
}
return result;
}
}

public void onSwipeRight() {
}

public void onSwipeLeft() {
}

public void triggerTouch() {
}

public void onSwipeBottom() {
}
}


So how to make the onFling be called when user swipes slightly off horizontal?


Thank you for your help!


Tommy



Read more

stackoverflow.comm



Push notification to send from admin app to user app in android [android help]


Push notification to send from admin app to user app in android



I am working on android applications. I have two apps, user app and admin app. My requirement is the user sends request to admin app, and when the admin finds if the request is useful then it will accept the request and will send a notification to the user.


Due to some problems I cant use either php or .net webservice to send the push notification to user app. So I used third party library to send the notification. I followed the tutorial of parse push notification from https://parse.com/tutorials/android-push-notifications and worked on that example. I am able to send the notification to my application.


But here according to my requirement, when the admin app sends a request to user app, how will it uniquely identifies the user. There will be so many users who use my app. Once the admin accepts the request of a particular user it will send a notificatin to only that particular user. How can I achieve this task using parse push notification.


I am storing the user details and admin details in server database.


Will be really thankful for any suggestions.



Read more

stackoverflow.comm



Thursday, November 28, 2013

How to have a getStringExtra message before onCreate method? [android help]


How to have a getStringExtra message before onCreate method?


java - How to have a getStringExtra message before onCreate method? - 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 two activities which in the first one I make a message and by putExtra I move it to next activity. But as you know to get the message in the secind activity I need to have getStringExtra in onCreate method. In the other hand I really need to have that message before onCreate starts. So how can I have that.



public class Result extends Activity {
String url; // <<< I need the message to put it here

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_single_result);

Intent intent = getIntent();
String mainURL = intent.getStringExtra(SingleSearchPage.EXTRA_MESSAGE); // Here is the message

url = mainURL; //Tried to change the value of URL but did not work

new GetJSONTask().execute(url);

}
class GetJSONTask extends AsyncTask {


protected JSONObject doInBackground(String... urls) {
// Creating new JSON Parser
JSONParser jParser = new JSONParser();

// Getting JSON from URL
JSONObject json = jParser.getJSONFromUrl(url);

return json;
}


Any idea to have the value of intent message before the onCreate?



















lang-java






Read more

stackoverflow.comm



Android SDK Eclipse Issue with Running in Emulator [android help]


Android SDK Eclipse Issue with Running in Emulator



I am building the layout for an android app. I am not getting any errors when running the app; however, I am getting an error right away when the app launches in the emulator. I am assuming it is a layout rendering fault. Where can I view the error, because no errors are shown in Eclipse.



Read more

stackoverflow.comm



Using get() and put() to access pixel values in OpenCV for JAVA [android help]


Using get() and put() to access pixel values in OpenCV for JAVA



I am a beginner in using OpenCV for JAVA. I want to access individual pixel values of an image matrix. Since, JAVA jar for OpenCV doesn't offer nice functions like C++, I ran into some trouble. After lot of searching, I found out two different methods to do that though they are not explained properly (not even in documentation). We can do that either using get() and put() functions or by converting the mat data into a primitive java type such as arrays. I tried both but getting different output results! Please help explaining what am I doing wrong. Am I using them wrong or some other silly problem. I am still a newbie so please forgive if its a stupid question. :)


CASE 1: Using get() function



Mat A = Highgui.imread(image_addr); \\"image_addr" is the address of the image
Mat C = A.clone();
Size sizeA = A.size();
for (int i = 0; i < sizeA.height; i++)
for (int j = 0; j < sizeA.width; j++) {
double[] data = A.get(i, j);
data[0] = data[0] / 2;
data[1] = data[1] / 2;
data[2] = data[2] / 2;
C.put(i, j, data);
}


CASE 2: Using Array



Mat A = Highgui.imread(image_addr); \\"image_addr" is the address of the image
Mat C = A.clone();
int size = (int) (A.total() * A.channels());
byte[] temp = new byte[size];
A.get(0, 0, temp);
for (int i = 0; i < size; i++)
temp[i] = (byte) (temp[i] / 2);
C.put(0, 0, temp);


Now according to my understanding they both should do the same thing. They both access the individual pixel values (all 3 channels) and making it half. I am getting no error after running. But, the output image I am getting is different in these two cases. Can someone please explain what is the issue? May be I don't understand exactly how get() function works? Is it because of the byte() casting? Please help.


Thanks!



Read more

stackoverflow.comm



Monday, November 25, 2013

Error #1009: Cannot access a property or method of a null object reference. -AS3 [android help]


Error #1009: Cannot access a property or method of a null object reference. -AS3



i got this error:



TypeError: Error #1009: Cannot access a property or method of a null object reference.
at TriviaGameDeluxe/saveScore()[TriviaGameDeluxe::frame102:19]


This is my code:



//**//
playAgainbutton.addEventListener(MouseEvent.CLICK,saveScore);


function saveScore(event:MouseEvent) { // Save the score


if (savedSN == null) { // Check if a game save is created. If it is not, create one
trace("New game save created");
savedSN = { // Set the varible 'savedSN'
name1:"-",
name2:"-",
name3:"-",
name4:"-",

score1:"-",
score2:"-",
score3:"-",
score4:"-"};
soSavedScNa.data.nameScore = savedSN; // Set the data in the save file to the
savedSN variable
soSavedScNa.flush(); // Overwrite existing save file

}

//**// Save the score
if ((gameScore > savedSN.score1 || savedSN.score1 == "-") &&
gameScore != 0) {
trace("Score 1");
savedSN = { // Set the date the savedSN varible will have
name1:PName.text,
name2:savedSN.name1,
name3:savedSN.name2,
name4:savedSN.name3,
score1:gameScore,
score2:savedSN.score1,
score3:savedSN.score2,
score4:savedSN.score3};
soSavedScNa.data.nameScore = savedSN; // Set the data in
the save file to the savedSN variable
soSavedScNa.flush(); // Overwrite existing save file
playAgainbutton.removeEventListener(MouseEvent.MOUSE_UP,
saveScore);
cleanUp();
gotoAndStop(1); // Go to the start menu
} else if ((gameScore > savedSN.score2 || savedSN.score2 == "-") &&
gameScore != 0) {
trace("Score 2");
savedSN = { // Set the date the savedSN varible will have
name1:savedSN.name1,
name2:PName.text,
name3:savedSN.name2,
name4:savedSN.name3,
score1:savedSN.score1,
score2:gameScore,
score3:savedSN.score2,
score4:savedSN.score3};
soSavedScNa.data.nameScore = savedSN; // Set the data in
the save file to the savedSN variable
soSavedScNa.flush(); // Overwrite existing save file
playAgainbutton.removeEventListener(MouseEvent.MOUSE_UP,
saveScore);
cleanUp();
gotoAndStop(1);
// Go to the start menu
} else if ((gameScore > savedSN.score3 || savedSN.score3 == "-") &&
gameScore != 0) {
trace("Score 3");
savedSN = { // Set the date the savedSN varible will have
name1:savedSN.name1,
name2:savedSN.name2,
name3:PName.text,
name4:savedSN.name3,
score1:savedSN.score1,
score2:savedSN.score2,
score3:gameScore,
score4:savedSN.score3};
soSavedScNa.data.nameScore = savedSN; // Set the data in
the save file to the savedSN variable
soSavedScNa.flush(); // Overwrite existing save file
playAgainbutton.removeEventListener(MouseEvent.MOUSE_UP,
saveScore);

cleanUp();
gotoAndStop(1); // Go to the start menu
} else if ((gameScore > savedSN.score4 || savedSN.score4 == "-") &&
gameScore != 0) {
trace("Score 4");
savedSN = { // Set the date the savedSN varible will have
name1:savedSN.name1,
name2:savedSN.name2,
name3:savedSN.name3,
name4:PName.text,
score1:savedSN.score1,
score2:savedSN.score2,
score3:savedSN.score3,
score4:gameScore};
soSavedScNa.data.nameScore = savedSN; // Set the data in
the save file to the savedSN variable
soSavedScNa.flush(); // Overwrite existing save file
playAgainbutton.removeEventListener(MouseEvent.MOUSE_UP,
saveScore);
cleanUp();
gotoAndStop(1); // Go to the start menu
}
}


I cannot find where the error is.. Hope anybody can help. Thanks.



Read more

stackoverflow.comm



File object can't find the file when there is one [android help]


File object can't find the file when there is one



In my app After user clicks on a button ,the download manager starts to download a file from internet and saving it to the internal sd card using this code:



void startDownload()
{
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).mkdirs();
download_req.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle(PersianReshape.reshape("Downloading"))
.setDescription(PersianReshape.reshape("currently downloading the file..."))
.setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory().getAbsolutePath() , packageId + ".sqlite");
download_ID = mgr.enqueue(download_req);
}


After it is downloaded, I plan to check its existance everytime app runs with this code:



String DatabaseAddress =
Environment.getExternalStorageDirectory().getAbsolutePath() +
"/ee.sqlite";
File file = new File(DatabaseAddress);
Log.d("PATH File: ", DatabaseAddress);
if (file.exists()){
Toast.makeText(getApplicationContext(), "found", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(), "not found", Toast.LENGTH_SHORT).show();
}


Now when I run this code it returns "not found" message whereas the file is already there (I checked its existance using a file manager).


the device I test on is nexus 7 and path used in saving the download file is: /storage/emulated/0/ee.sqlite


ee.sqlite is the filename of downloaded file.


/storage/emulated/0/ is the default path returned by app


Permissions added to manifest for this code are:







Q: Why does file.exists() returns false when there is a file?



Read more

stackoverflow.comm



Disable checkbox if X are checked in android [android help]


Disable checkbox if X are checked in android



I have 15 CheckBox and I must to stuck user when he checks more than 5 CheckBox. Is it possible? I used the method OnCheckedChangeListener to know if an item was checked... but I don't know how to make a limit after 5 items selected. See what I've tried to do below:


I instante my integer:



int lengthBox = 15;
int lenghtMax = 5;


I select all my View in onCreate():



View[] tagsItem = new View[] {
findViewById(R.id.TagsCheckAA),
findViewById(R.id.TagsCheckBB),
findViewById(R.id.TagsCheckCC),
findViewById(R.id.TagsCheckDD),
findViewById(R.id.TagsCheckEE),
findViewById(R.id.TagsCheckFF),
findViewById(R.id.TagsCheckGG),
findViewById(R.id.TagsCheckHH),
findViewById(R.id.TagsCheckII),
findViewById(R.id.TagsCheckJJ),
findViewById(R.id.TagsCheckKK),
findViewById(R.id.TagsCheckLL),
findViewById(R.id.TagsCheckMM),
findViewById(R.id.TagsCheckNN),
findViewById(R.id.TagsCheckOO)
};


I create 15 CheckBox:



final CheckBox[] tagsCheck = new CheckBox[lengthBox];


Create the method (and it's here where I don't know what to do exactly):



OnCheckedChangeListener checker = new OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton cb, boolean b) {
if(tagsCheck[0].isChecked() || tagsCheck[1].isChecked() ||
tagsCheck[2].isChecked() || tagsCheck[3].isChecked() ||
tagsCheck[4].isChecked() || tagsCheck[5].isChecked() ||
tagsCheck[6].isChecked() || tagsCheck[7].isChecked() ||
tagsCheck[8].isChecked() || tagsCheck[9].isChecked() ||
tagsCheck[10].isChecked() || tagsCheck[11].isChecked() ||
tagsCheck[12].isChecked() || tagsCheck[13].isChecked() ||
tagsCheck[14].isChecked()) {
if(lenghtCount < 5){
// How can I get the String of the CheckBox
// which just checked?
String tags = (String) tagsCheck[].getText();
Toast.makeText(getApplicationContext(),
tags + " checked", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(),
"Limit reached!!!", Toast.LENGTH_SHORT).show();
}
}
}
};


After this, I set my View id to my CheckBox and call the method:



for(int i = 0; i < lengthBox; i++) {
tagsCheck[i] = (CheckBox) tagsItem[i];
tagsCheck[i].setOnCheckedChangeListener(checker);
}


Can someone point me in the right way, please?


Thanks, any help will be appreciate.



UPDATE:


I found an inelegant way with an if(tagsCheck[0].isChecked() || ...). But I have still a problem: how can I get the CheckBox which just checked? Cause of my if(), I don't know how can I do this.


Thanks!



Read more

stackoverflow.comm



MediaRecorder crash [android help]


MediaRecorder crash




Very beginner in Android/Java, coming from C and Symbian, I started from the Hellworld example to try to display the sound level (the project is to record this level in a text file for hours). This code is written in the MainActivity file, as a method inside the MainActivity Class :



public void GetAFlevel(View view) throws IllegalStateException, IOException {
float audiolevel = 0, maxal = 0;
MediaRecorder mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile("/dev/null");
mRecorder.prepare();
mRecorder.start();
for (int i = 0; i < 1000; i++) {
audiolevel = mRecorder.getMaxAmplitude();
if (audiolevel > maxal)
maxal = audiolevel;
}
EditText editText1 = (EditText) findViewById(R.id.editText1);
editText1.setText(String.valueOf(maxal));
mRecorder.stop();
mRecorder.release();
mRecorder = null;
}


The result is a crash of the application on the target :



11-17 00:23:09.859: D/AndroidRuntime(22096): Shutting down VM

11-17 00:23:09.859: W/dalvikvm(22096): threadid=1: thread exiting with uncaught exception (group=0x40018578)

11-17 00:23:09.921: E/AndroidRuntime(22096): FATAL EXCEPTION: main

11-17 00:23:09.921: E/AndroidRuntime(22096): java.lang.IllegalStateException: Could not execute method of the activity


No crash if I remove the following MediaRecorder functions : setAudioSource, setOutputFormat, setAudioEncoder, setOutputFile, prepare, start and stop, but getMaxAmplitude returns 0, of course.


As soon as I add only setAudioSource (normaly the only necessary for getMaxAmplitude), crash !


Any idea ?


Thanks in advance.



Read more

stackoverflow.comm



Sunday, November 24, 2013

Why can't I take screenshots in Android Emulator after installing Genymotion? [android help]


Why can't I take screenshots in Android Emulator after installing Genymotion?


Why can't I take screenshots in Android Emulator after installing Genymotion? - 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've installed Genyomtion android emulator. Then I realized I can't take screenshots in Eclipse DDMS view. After that, I tried to take a screenshot with standard android emulator that comes with the SDK. It didn't work. Eclipse shows me a black image instead of screenshot. It worked before I installed Genymotion! It's suspicious that Genymotion hacked my ADB, because screenshot taking is part of PAID version of GenyMotion!


Has anyone experienced the same problem? How can I get Eclipse taking screenshots again without reinstalling it?


Thanks in advance!


























It's a known bug on 4.3 images, they are working on a fix. On a 4.2.2 image it's working for me, you can try to create a 4.2.2 device to take screenshot in the meantime.


Source: On twitter @genymotion responded to @Littledot1230 on this question :)























I have just used Genymotion and Eclipse DDMS today to take a screenshot for an app store submission.


So it works on at least these versions on my Win8 Pro machine:


  • Genymotion v1.1.0

  • Android 4.2.2 10" image

  • Eclipse ADT v22.0.1

Edit: so 4.2.2 is why mine worked - thanks Bonrry























default






Read more

stackoverflow.comm



Screen becomes blank for long time while loading SherlockFragmentActivity with fragments [android help]


Screen becomes blank for long time while loading SherlockFragmentActivity with fragments



I am implementing jeremyfeinstein sliding menu library. for this I have an activity which extends SherlockFragmentActivity. for this activity I have two fragments one is for left menu and another is for Main screen. Everything is working fine and smooth but still I have a problem that is when my Sliding menu activity starts, it becomes blank for 8-10 seconds. after 8-10 seconds my main screen fragment becomes visible. this is my base class:



public class SlidingFragmentActivity extends SherlockFragmentActivity implements SlidingActivityBase {

private SlidingActivityHelper mHelper;

/* (non-Javadoc)
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHelper = new SlidingActivityHelper(this);
mHelper.onCreate(savedInstanceState);
}

/* (non-Javadoc)
* @see android.app.Activity#onPostCreate(android.os.Bundle)
*/
@Override
public void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
mHelper.onPostCreate(savedInstanceState);
}

/* (non-Javadoc)
* @see android.app.Activity#findViewById(int)
*/
@Override
public View findViewById(int id) {
View v = super.findViewById(id);
if (v != null)
return v;
return mHelper.findViewById(id);
}

/* (non-Javadoc)
* @see android.support.v4.app.FragmentActivity#onSaveInstanceState(android.os.Bundle)
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mHelper.onSaveInstanceState(outState);
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(int)
*/
@Override
public void setContentView(int id) {
setContentView(getLayoutInflater().inflate(id, null));
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(android.view.View)
*/
@Override
public void setContentView(View v) {
setContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}

/* (non-Javadoc)
* @see android.app.Activity#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
@Override
public void setContentView(View v, LayoutParams params) {
super.setContentView(v, params);
mHelper.registerAboveContentView(v, params);
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(int)
*/
public void setBehindContentView(int id) {
setBehindContentView(getLayoutInflater().inflate(id, null));
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View)
*/
public void setBehindContentView(View v) {
setBehindContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setBehindContentView(View v, LayoutParams params) {
mHelper.setBehindContentView(v, params);
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#getSlidingMenu()
*/
public SlidingMenu getSlidingMenu() {
return mHelper.getSlidingMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#toggle()
*/
public void toggle() {
mHelper.toggle();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showAbove()
*/
public void showContent() {
mHelper.showContent();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showBehind()
*/
public void showMenu() {
mHelper.showMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showSecondaryMenu()
*/
public void showSecondaryMenu() {
mHelper.showSecondaryMenu();
}

/* (non-Javadoc)
* @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setSlidingActionBarEnabled(boolean)
*/
public void setSlidingActionBarEnabled(boolean b) {
mHelper.setSlidingActionBarEnabled(b);
}

/* (non-Javadoc)
* @see android.app.Activity#onKeyUp(int, android.view.KeyEvent)
*/
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean b = mHelper.onKeyUp(keyCode, event);
if (b) return b;
return super.onKeyUp(keyCode, event);
}

}


Here is my Main activity which loads fragments



public class SliderMenuMainActivity extends SlidingFragmentActivity
{
private Fragment mContent;
ImageButton btnToggle,refresh;
String ns = Context.NOTIFICATION_SERVICE;
public static int msg_count = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(obj==null)
obj=new Progress_Dialog(this);
obj.setCancelable(false);
obj.onPreExecute("MAIN Screen");
if (savedInstanceState != null)
mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
prepareScreen();
}
private void prepareScreen()
{
setContentView(R.layout.activity_slider_menu_main);

ActionBar ab = getSherlock().getActionBar();
LayoutInflater li = LayoutInflater.from(this);
View customView = li.inflate(R.layout.custom_titlebar, null);
customView.setLayoutParams(new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT ,ActionBar.LayoutParams.MATCH_PARENT));
ab.setCustomView(customView);
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowCustomEnabled(true);
if (findViewById(R.id.menu_frame) == null)
{
setBehindContentView(R.layout.menu_frame);
getSlidingMenu().setSlidingEnabled(true);
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
// show home as up so we can toggle
//getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
else
{
// add a dummy view
View v = new View(this);
setBehindContentView(v);
getSlidingMenu().setSlidingEnabled(false);
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
}


if (mContent == null)
mContent = new MainScreenFragment();

getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, mContent).commit();

// set the Behind View Fragment
getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new MenuFragment()).commit();

// customize the SlidingMenu
SlidingMenu sm = getSlidingMenu();
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindScrollScale(0.25f);
sm.setFadeDegree(0.25f);
setSlidingActionBarEnabled(false);

}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
toggle();
}
return super.onOptionsItemSelected(item);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
getSupportFragmentManager().putFragment(outState, "mContent", mContent);
}
public void switchContent(final Fragment fragment) {
mContent = fragment;
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, fragment)
.commit();
Handler h = new Handler();
h.postDelayed(new Runnable() {
public void run() {
getSlidingMenu().showContent();
}
}, 50);
}

@Override
public void onResume()
{
super.onResume();
if(obj!=null)
obj.onPostExecute();
}
}


So please help me with this and show me a way to overcome this problem. thanks in advance.



Read more

stackoverflow.comm



Tuesday, November 19, 2013

Samsung Galaxy-Q gets stuck on startscreen and recovery screen wont boot, HELP PLEASE. NEED PHONE! [General]


Samsung Galaxy-Q gets stuck on startscreen and recovery screen wont boot, HELP PLEASE. NEED PHONE!



Hey guys, just got a samsung galaxy-Q from a friend and shortly after recieving memory errors my phone got stuck on its startscreen so I looked online for help and it said to use the reboot option in the recovery screen but my phone wont launch it for some reason after trying over a thousand times.. PLEASE SOMEONE HELP!! I need my phone very urgently for buisness



Read more

forum.xda-developers.com



Monday, November 18, 2013

Android KitKat set language for Bluetooth voice dial [General]


Android KitKat set language for Bluetooth voice dial



Android KitKat set language for Bluetooth voice dial

Hi, i'm having a problem with my new Nexus 5. Please note this is my first android device.

I cant figure out how to change the input language for dialing with a bluetooth headset which is pretty annoying since most of my contacts have french names. Everything else works fine with french voice commands on the phone except for the bluetooth voice dialer which always specifies English on the top right.

Android KitKat set language for Bluetooth voice dial-bluetoothlang.jpg

Can anyone tell me how to change this? I would prefer to keep the menus un english if possible, but I have even tried removing english and setting french everywhere and it didn't change the voice dialing option.

Thank you



Read more

forum.xda-developers.com



Storage [General]


Storage



My phone is really struggling for storage so I deleted a bunch of videos and pictures worth about 150Mb. That did not make a difference at all for some reason. Anyways if I go to Settings --> Apps --> Here I see my download phone memory is almost full but my internal storage is almost empty with almost 2GB free. And is RAM has just gone to **** and is literally full. Can I remove everything for downloads if its now on my internal storage? And what can I do about the RAM? Thanks.



Read more

forum.xda-developers.com



Text inflation in Chrome on Nexus 5 [General]


Text inflation in Chrome on Nexus 5



First post and a new Android convert here, so excuse me if I at any point come across as a bit daft. Anywho...

I picked up a Nexus 5 last week and noticed that Chrome inflates text in places it shouldn't. I seems to happen on sites like Reddit or other forum/comment driven sites, with lots of text in lots of frames and elements and such. The top of the pages are fine, but after a certain point down the page everything becomes inflated. Screen cap linked to so you can see what I mean.

I haven't had the chance to play around with my phone nearly enough to confirm, but it seems to be specific to Chrome... Firefox and Opera render pages perfectly. I've reformatted the phone, made sure the OS and all apps are up to date, closed out all other apps, etc etc, to no avail. I've tried searching for an answer online, both here and elsewhere, but I can't seem to find anything. I even called Google, but the rep was a bit clueless and kept insisting it must be some kind of connectivity issue.

Anyway, it's not a huge thing, but it's annoying me to no end that I can't figure it out. Help?



Read more

forum.xda-developers.com



Adding a marker results in NullPointerException in Android [android help]


Adding a marker results in NullPointerException in Android



This is a part of my project. I am getting an arraylist of longitude and latitude from the previous class. Without the marker code, the app is working properly but when I add the marker code the app is terminating due to NullpointerException. Can anyone tell me why ?



package xyz;

import...

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class Route extends Activity {
GoogleMap map;
PolylineOptions polylineOptions;
ArrayList longitude,latitude;


@SuppressWarnings("unchecked")
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.route);
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();

double s_latitude = latitude.get(0);
double s_longitude=longitude.get(0);


/* If I add this line the app is terminating.
map.addMarker(new MarkerOptions()
.position(new LatLng(s_latitude,s_longitude))
.title("Start Point"));
*/

longitude = (ArrayList) getIntent().getSerializableExtra("Longitude");
latitude = (ArrayList) getIntent().getSerializableExtra("Latitude");

CameraUpdate center=
CameraUpdateFactory.newLatLng(new LatLng(latitude.get(0),
longitude.get(0)));
CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);

map.moveCamera(center);
map.animateCamera(zoom);



polylineOptions=new PolylineOptions();

for(int i=0;i {
polylineOptions.add(new LatLng(latitude.get(i), longitude.get(i)));
}

polylineOptions.color(Color.BLUE);
polylineOptions.width(10);

polylineOptions.geodesic(false);


map.addPolyline(polylineOptions);


}
}


11-10 21:15:14.027: E/AndroidRuntime(25929): FATAL EXCEPTION: main 11-10 21:15:14.027: E/AndroidRuntime(25929): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sensordatacollector.smartrac/com.sensordatacollector.smartrac.Route}: java.lang.NullPointerException 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread.access$600(ActivityThread.java:151) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1330) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.os.Handler.dispatchMessage(Handler.java:99) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.os.Looper.loop(Looper.java:155) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread.main(ActivityThread.java:5536) 11-10 21:15:14.027: E/AndroidRuntime(25929): at java.lang.reflect.Method.invokeNative(Native Method) 11-10 21:15:14.027: E/AndroidRuntime(25929): at java.lang.reflect.Method.invoke(Method.java:511) 11-10 21:15:14.027: E/AndroidRuntime(25929): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074) 11-10 21:15:14.027: E/AndroidRuntime(25929): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841) 11-10 21:15:14.027: E/AndroidRuntime(25929): at dalvik.system.NativeStart.main(Native Method) 11-10 21:15:14.027: E/AndroidRuntime(25929): Caused by: java.lang.NullPointerException 11-10 21:15:14.027: E/AndroidRuntime(25929): at com.sensordatacollector.smartrac.Route.onCreate(Route.java:36) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.Activity.performCreate(Activity.java:5066) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1102) 11-10 21:15:14.027: E/AndroidRuntime(25929): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2288) 11-10 21:15:14.027: E/AndroidRuntime(25929): ... 11 more



Read more

stackoverflow.comm



What is the befitting protocol between mobile(iphone, android) and server PHP/MySQL? [android help]


What is the befitting protocol between mobile(iphone, android) and server PHP/MySQL?



How are you?
I am developing the School-Parents Message Systems.
Here is my initial system spec.
1. School teacher create a new message on PC(by website) or Mobile(by website or mobile app).
In this point of time, the teacher can set a parents list that should be received the message.
2. Each mobile device of the parents list display the message that the teacher already created.
3. The parents can reply to the teacher concerning the message on mobile.
4. The teacher also can reply to the parents concerning the message that was replied by parents on mobile(of course the teacher can reply on PC).
The messages can be communicated between teacher-parents, teacher-pupils, teacher-teacher, parents-parents, parents-pupils, pupils-pupils.

Here is my initial development spec.
I am guessing the number of clients include teacher, parents and pupils as 200,000+.
I need to develop for the iphone and android.
I am going to use the PHP/MySQL for the development of server side.
So, I am planning to implement the server side in the following way.
I.E. All of the messages are created to the MySQL DB.
In DB may be exist the config parameter field can specify the messages such as created_date, sender, receiver, deliver_date etc.
Then a mobile device check a new message in DB regularly and display the message.
If a clients reply to the message, then the message will be send to the server and is inserted in DB.

It is my small idea.
So, what is the my questions and problems?

How can the mobile device check a new message regularly?
Probably, you might advise to use the Push Notification service.
But, I cannot use any other service.

1. What is the protocol between mobile and server?
I am guessing to use HTTP.
So, JSON or XML might be offered the data to communicate between mobile app and server.

2. How can be executed the mobile app regularly?
I hope, whenever new message is registered in our system, that should be reflected into the mobile app immediatly, not pulling regularly.

If it is impossible, so the mobile check regularly e.g. 1min or 10min or 30min, then when use HTTP, here it is my cares.
Regularly the mobile can be access to server to check a new message.
Number of clients is larger than 200,000+.
So, server always must reponse about the request from 200,000+ clients regularly(e.g. 1min or 10min or 30min).
Is it clear architecture?
I am very trouble in the server performance point of view.

If you have a good idea and excellent architecture system, please teach me.

Thanks a lot for your time.

Kind regards
Niao Jina



Read more

stackoverflow.comm



Sunday, November 17, 2013

How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8? [android help]


How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8?


android - How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8? - Stack Overflow







Tell me more ×

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
















I'm confused with this fact, and I think some feature must require


getActionBar()


and this function requires a min SDK of 11, but how can Google make those features possible?


I wonder Google may use ActionBarSherlock, is this just the reason? But there is no mention of using it, but how can Google do this?


Thanks for your answering.





























Google is actually working on ActionBarCompat . It's basically a ActionBarSherlock from Google.
I suppose they are testing this in some apps already since they said at Google I/O that it is in an advanced state of development. I think they will release this in the next few months.
























but how can Google make those features possible?



They made their own action bar, presumably.



I wonder Google may use ActionBarSherlock, is this just the reason?



You are welcome to get a job with Google, attempt to join the Google Shopper team, and ask them.



And have anyone ever use ActionBarSherlock on Android 2.2, plz tell me if it can make things just as well as ActionBar?



ActionBarSherlock definitely supports Android 2.2.




















default






Read more

stackoverflow.comm



Admob in xml not showing in Linear [android help]


Admob in xml not showing in Linear


android - Admob in xml not showing in Linear - 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 implementing admob on my app it appears when the parent is in relative layout but i must not use the alignparentbottom so i am changing it to linear but it doesnt show when i change it to linear..


any tips? help? thanks in advance


here it is in xml:




android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

android:id="@+id/banner_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

android:id="@+id/offline_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@color/black"
android:src="@drawable/offline_banner" />

xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/unit_id"
ads:loadAdOnCreate="true" />

android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />



i want the admob to be at the bottom part of the screen without using the alignparentbottom of relative layout


thanks~



















lang-xml






Read more

stackoverflow.comm



Listview not showing on orientation Change [android help]


Listview not showing on orientation Change



I have previously done a listview and the list is being displayed whether in landscape or portrait orientation. However, in my new app, when I decide to change orientation, whether landscape to portrait or vice versa, it does not load again. I am trying to populate the listview with items from sqlite database. Here is my code:


Attractions.java



public class Attractions extends ListActivity {
DataBaseHandler db = new DataBaseHandler(this);
ArrayList imageArry = new ArrayList();
ContactImageAdapter adapter;
int ctr, loaded;
int [] landmarkImages={R.drawable.oblation,R.drawable.eastwood,R.drawable.ecopark,R.drawable.circle};
String []landmarkDetails = { "Oblation", "Eastwood", "Ecopark", "QC Circle"};

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_attractions);
ctr = db.checkContact(landmarkDetails[loaded]);
db.deleteAll();


// get image from drawable

/**
* CRUD Operations
* */
// Inserting Contacts
Log.d("Insert: ", "Inserting ..");


for(loaded=0; loaded
Bitmap image = BitmapFactory.decodeResource(getResources(),
landmarkImages[loaded]);

// convert bitmap to byte
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte imageInByte[] = stream.toByteArray();
Log.d("Going to load images", "Image "+ loaded);

Log.d("Goind to load objects", "loading");

if(ctr == 0){
Log.d("Nothing Loaded", "Loading Now");
db.addContact(new Contact(landmarkDetails[loaded], imageInByte));}
Log.d(landmarkDetails[loaded], "Loaded!");
image.recycle();
}


// Reading all contacts from database
List contacts = db.getAllContacts();
for (Contact cn : contacts) {
String log = "ID:" + cn.getID() + " Name: " + cn.getName()
+ " ,Image: " + cn.getImage();

// Writing Contacts to log
Log.d("Result: ", log);
//add contacts data in arrayList
imageArry.add(cn);

}
adapter = new ContactImageAdapter(this, R.layout.screen_list,
imageArry);
ListView dataList = (ListView) findViewById(android.R.id.list);
dataList.setAdapter(adapter);
}


UPDATE


I ran the app on portrait mode: list present, when switched to landscape: does not display anything. I switch to portrait again: list present again.



Read more

stackoverflow.comm



Linking to image in sdcard PhoneGap [android help]


Linking to image in sdcard PhoneGap



I have a saved image in android "mnt/sdcard/offlineImages" folder. The image is named img_0.jpg.


Now I want to display this image on a html page via javascript.


I tried the following two cases.


CASE ONE WHICH WORKS.



html


javaScript
document.getElementById('anImg').src = "file:///mnt/sdcard/offlineImages/img_0.jpg";


CASE TWO, WHICH DOESN'T WORK.



html


javascript
var anImg = new Image();
anImg.src = "file:///mnt/sdcard/offlineImages/img_0.jpg";
document.getElementById("img_wrap").appendChild(anImg);


Read more

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