Monday, April 15, 2013

[General] Damaged Screen help.


First off do you have insurance on your phone. This could be in handy if the Device Company says it is user fault. Typically this rarely happens with an undamaged screen but it is insurance for a reason.

I would call HTC device services and speak to a representative. Explain to them that this has occurred and there was no physical damage to the phone and it started happening. With this issue it could be a hardware malfunction and they could send you a replacement phone. I would not recommend fixing the phone yourself until you call technical services. Sometimes companies have issues with their phones and do not advertise it because it is not a majority.

I have had an issue similar with a samsung phone and received a free replacement and upgrade. (this is going 5 years back). Your provider can only guarantee a warranty for an X amount of days where the physical device is under a 1 year warranty.

All else fails and you have the insurance, I would pay the deductible for a replacement when you file a claim.



.

forum.xda-developers.com

[android help] Referencing jar file of google play service in map v2 project

android - Referencing jar file of google play service in map v2 project - Stack Overflow



















I'm trying to reference the jar file of google-play-service-lib but each time i reference it from the properties window, it gives me a red cross beside the lib. I tried uninstalling the google play service from the SDK service and re-installing it again.. also it didn't work up.


okay now i've changed the path of importing to the same drive where i keep my projects and thx god it worked... but now the maps open with a white blank page.


and what was written in the logcat : Unable to load google maps


can u please help me solving this issue :)





























import “google-play-services_lib”.
Select File-->Import
Select Android-->Existing Android Code into Workspace
Browse and select \sdk\extras\google\google_play_services\libproject
Select “google-play-services_lib” and finish.

for detailed steps have a look at to my blog: http://umut.tekguc.info/en/content/google-android-map-v2-step-step




















default






.

stackoverflow.comm

[android help] Jelly Bean Screen Capture on Device With No Volume Buttons


I am aware of the screen capture feature in Jelly Bean. This requires pressing the power and volume hardware buttons to do a capture. However, the hardware on which I am working does not have any hardware volume buttons. Is there any non-programmatic alternative to performing a screen capture?



.

stackoverflow.comm

[android help] Best practice to store keys associated with a class


I want to share what I did for preferences storage, I use android's build in feature called SharedPreferences. For easy access, I create a wrapper around SharedPreferences called UserModel that have codes like this:



package tv.gsgw.android.garusuta.model;

import id.flwi.util.ActivityUtil;
import tv.gsgw.android.garusuta.constant.DataConstant;
import android.content.Context;

public class UserModel implements DataConstant {
Context _context;

private String authKey = "";
private String email = "";
private String password = "";
private String birthdate = "";
private String prefacture = "";
private String bloodType = "";
private String idealBodyType = "";
private String duration = "";
private String stability = "";
private String skin = "";
private String relationship = "";
private String height = "";
private String weight = "";
private boolean registerDataChange = false;

public UserModel(Context context){
this._context = context;
loadFromPreferences();
}

public void loadFromPreferences(){
setAuthKey(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_AUTHKEY, ""));
setEmail(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_EMAIL, ""));
setPassword(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_PASSWORD, ""));
setBirthdate(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_BIRTHDATE, ""));
setPrefacture(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_PREFACTURE, ""));
setBloodType(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_BLOODTYPE, ""));
setIdealBodyType(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_BODYTYPE, ""));
setPeriod(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_DURATIONPERIOD, ""));
setStability(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_STABILITY, ""));
setSkin(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_SKINTYPE, ""));
setRelationship(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_RELATIONSHIP, ""));
setHeight(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_HEIGHT, ""));
setWeight(ActivityUtil.getSharedPreferenceString(_context, USER_DATA_FIELD_NAME_WEIGHT, ""));
setRegisterDataChange(ActivityUtil.getSharedPreferenceBoolean(_context, USER_DATA_FIELD_REGISTER_DATACHANGE, false));
}

public void saveIntoPreferences(){
saveIntoPreferences(true);
}
public void saveIntoPreferences(boolean datachanged){
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_AUTHKEY, getAuthKey());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_EMAIL, getEmail());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_PASSWORD, getPassword());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_BIRTHDATE, getBirthdate());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_PREFACTURE, getPrefacture());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_BLOODTYPE, getBloodType());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_BODYTYPE, getIdealBodyType());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_DURATIONPERIOD, getPeriod());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_STABILITY, getStability());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_SKINTYPE, getSkin());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_RELATIONSHIP, getRelationship());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_HEIGHT, getHeight());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_NAME_WEIGHT, getWeight());
ActivityUtil.setSharedPreference(_context, USER_DATA_FIELD_REGISTER_DATACHANGE, datachanged);
}

public String getAuthKey() {
return authKey;
}

public void setAuthKey(String authKey) {
this.authKey = authKey;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getBirthdate() {
return birthdate;
}

public void setBirthdate(String birthdate) {
this.birthdate = birthdate;
}

public String getPrefacture() {
return prefacture;
}

public void setPrefacture(String prefacture) {
this.prefacture = prefacture;
}

public String getBloodType() {
return bloodType;
}

public void setBloodType(String bloodType) {
this.bloodType = bloodType;
}

public String getIdealBodyType() {
return idealBodyType;
}

public void setIdealBodyType(String idealBodyType) {
this.idealBodyType = idealBodyType;
}

public String getPeriod() {
return duration;
}

public void setPeriod(String period) {
this.duration = period;
}

public String getSkin() {
return skin;
}

public void setSkin(String skin) {
this.skin = skin;
}

public String getRelationship() {
return relationship;
}

public void setRelationship(String relationship) {
this.relationship = relationship;
}

public String getHeight() {
return height;
}

public void setHeight(String height) {
this.height = height;
}

public String getWeight() {
return weight;
}

public void setWeight(String weight) {
this.weight = weight;
}

public boolean isRegisterDataChange() {
return registerDataChange;
}

public void setRegisterDataChange(boolean registerDataChange) {
this.registerDataChange = registerDataChange;
}

public String getStability() {
return stability;
}

public void setStability(String stability) {
this.stability = stability;
}

public void setRegistrationChanged(boolean dataChange) {
this.registerDataChange = dataChange;
}

public String toString(){
String str = "";

str += "authKey: " + authKey + "\n";
str += "email: " + email + "\n";
str += "password: " + password + "\n";
str += "birthdate: " + birthdate + "\n";
str += "prefacture: " + prefacture + "\n";
str += "bloodType: " + bloodType + "\n";
str += "idealBodyType: " + idealBodyType + "\n";
str += "duration: " + duration + "\n";
str += "stability: " + stability + "\n";
str += "skin: " + skin + "\n";
str += "relationship: " + relationship + "\n";
str += "height: " + height + "\n";
str += "weight: " + weight + "\n";
str += "registerDataChange: " + (registerDataChange ? "true" : "false") + "\n";

return str;
}

}


DataConstant in code above is just a class that contain constant variable like this:



public static final String USER_DATA_FIELD_NAME_AUTHKEY = "new_AuthKey";
public static final String USER_DATA_FIELD_NAME_EMAIL = "new_Email";
public static final String USER_DATA_FIELD_NAME_PASSWORD = "new_Password";
public static final String USER_DATA_FIELD_NAME_BIRTHDATE = "new_Birthday";
public static final String USER_DATA_FIELD_NAME_PREFACTURE = "new_Prefacture";
public static final String USER_DATA_FIELD_NAME_BLOODTYPE = "new_BloodType";
public static final String USER_DATA_FIELD_NAME_BODYTYPE = "new_IdealBodyType";
public static final String USER_DATA_FIELD_NAME_DURATIONPERIOD = "new_Duration";
public static final String USER_DATA_FIELD_NAME_STABILITY = "new_Stability";
public static final String USER_DATA_FIELD_NAME_SKINTYPE = "new_Skin";
public static final String USER_DATA_FIELD_NAME_RELATIONSHIP = "new_Relationship";
public static final String USER_DATA_FIELD_NAME_HEIGHT = "new_Height";
public static final String USER_DATA_FIELD_NAME_WEIGHT = "new_Weight";
public static final String USER_DATA_FIELD_NAME_PHY_1 = "new_phy1";
public static final String USER_DATA_FIELD_NAME_PHY_2 = "new_phy2";


This use an utility class that also create to help working with SharedPreferences easier:



package id.flwi.util;

/**
* @author Arief Bayu Purwanto
*/
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Calendar;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;

public class ActivityUtil {
public static final String PREFS_NAME = "____MyPrefsFile";

public static void debugExtra(Bundle extras){
if( extras != null) {
Log.i("Log", "printing all extras information");
java.util.Set keys = extras.keySet();
java.util.Iterator keyIterator = keys.iterator();
int index = 0;
while(keyIterator.hasNext()) {
Log.i("log", " extras #" + (++index) + ": " + keyIterator.next());
}
} else {
Log.i("Log", "empty extras");
}
}

public static boolean getSharedPreferenceBoolean(Context c, String preference){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getBoolean(preference, false);
}
public static boolean getSharedPreferenceBoolean(Context c, String preference, boolean defaultValue){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getBoolean(preference, defaultValue);
}
public static String getSharedPreferenceString(Context c, String preference){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getString(preference, "");
}
public static String getSharedPreferenceString(Context c, String preference, String defaultValue){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getString(preference, defaultValue);
}
public static int getSharedPreferenceInt(Context c, String preference, int defaultValue){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getInt(preference, defaultValue);
}

public static long getSharedPreferenceLong(Context c, String preference, long defaultValue){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
return settings.getLong(preference, defaultValue);
}

public static void setSharedPreference(Context c, String preference, boolean prefValue){

SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(preference, prefValue);
editor.commit();
}

public static void setSharedPreference(Context c, String preference, Long prefValue){

SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putLong(preference, prefValue);
editor.commit();
}

public static void setSharedPreference(Context c, String preference, int prefValue){

SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putInt(preference, prefValue);
editor.commit();
}
public static void setSharedPreference(Context c, String preference, String prefValue){
SharedPreferences settings = c.getSharedPreferences(ActivityUtil.PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString(preference, prefValue);
editor.commit();
}

}


Using it is pretty simple:



  1. To load the data, you just have to call:



    UserModel sharedData = new UserModel(getApplicationContext());



  2. To change or retrieve data just call it's associated field getter/setter:



    sharedData.getPassword();
    sharedData.setPassword("new password");



  3. Finally, if you change field(s), just don't forget to call saveIntoPreferences:



    sharedData.saveIntoPreferences();


Hope this help to solve your problem.



.

stackoverflow.comm

[android help] Nested set activity for result android

Nested set activity for result android - Stack Overflow



















I have 3 activities. A,B and C. A calls B, B calls C, and the result of C should be received in A. Can you please suggest how to go about it?? I m killing B using finish() after it calls C. So, the result of C should go directly to A Activityonresult. Is it possible??. Please give your suggestions!


























Don't kill B, in A start activity B using startActivityForResult and in B start activity C using startActivityForResult then in B onActivityResult



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);

setResult(RESULT_OK, intent);
finish();
}


where intent is the intent sent back from C. Now A will receive this intent in A onActivityResult.


























What if you call C from A? Something like: A calls B; instead of calling C from B, finish it and make A call C.


Unless the result of C affects B. In such case you have no choice but handling the result of C in B, and set the result of A from there if needed.




















default






.

stackoverflow.comm

[android help] Something wrong happened when updating app online


Recently I just meet a problem when I want to update my app online. My codes are shown below:



try {
if (Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED)) {
String sdpath = Environment.getExternalStorageDirectory()+ "/";
mSavePath = sdpath + "download/";
URL url = new URL(downUrl);
conn = (HttpURLConnection) url.openConnection();
conn.connect();
// get the size of target file
int length = conn.getContentLength();
is = conn.getInputStream();

File file = new File(mSavePath);
if (!file.exists()) {
file.mkdir();
}
File apkFile = new File(mSavePath, FILE_NAME);
fos = new FileOutputStream(apkFile);
int count = 0;
byte buf[] = new byte[1024];
do {
int numread = is.read(buf);
count += numread;
progress = (int) (((float) count / length) * 100);
mHandler.sendEmptyMessage(DOWNLOAD);
if (numread <= 0) {
fos.flush();
isDownloadFinished = true;
break;
}
fos.write(buf, 0, numread);
fos.flush();
} while (true); // just for test
} else {
System.out.println("no external SDcard");
}
} catch (Exception e) {
mHandler.sendEmptyMessage(DOWNLOADFAIL);
e.printStackTrace();
} finally {
try {
conn.disconnect();
fos.close();
is.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
mDownloadDialog.dismiss();
if (isDownloadFinished == true) {
mHandler.sendEmptyMessage(DOWNLOAD_FINISH);
}
}


And in handleMessage(), there is a function: installApk(). Of course it's in case DOWNLOAD_FINISH.



private void installApk() {
File apkfile = new File(mSavePath, FILE_NAME);
if (!apkfile.exists()) {
return;
}
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(mSavePath + FILE_NAME)),
"application/vnd.android.package-archive");
FileDownloadActivity.this.startActivity(i);
}


OK, this is my main code. Simply what I want to do is to replace(or we can say "update") current app with new version which just been downloaded. And next step is to click "Yes" when the dialog which alert us with something like "you're goning to replace the app" shown. Then a progress shown,which means the new verion app is been installing. BUT, now the problem appear: the install surface just exit without any result, alert or infotmation! This is a very simple test app, without anything such as:database, package sign and so on. So anybody met this problem? I need your help. Oh, by the way, forgive my damn poor English... :)



.

stackoverflow.comm

[android help] GetSupportActionBar return null


After I started my second Activity, there isn't the ActionBar. When I call GetSupportActivity, it returns null. Why? I have minSdkVersion 10 and targetSdkVersion 15.



package="com.test.myapp"
android:versionCode="1"
android:versionName="1.0" >

android:minSdkVersion="10"
android:targetSdkVersion="15"
/>



android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light"
>
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:windowSoftInputMode="stateHidden"
>






android:name=".ShowMusic2"
android:label="Search Results">









This is the OnCreate of my second activity (ShowMusic2). It is a ListActivity.



public class ShowMusic2 extends SherlockListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

getSupportActionBar().setDisplayHomeAsUpEnabled(true);

showMusic = getIntent();
pkgName = getPackageName();
html = (String)showMusic.getStringExtra(pkgName + ".html");
new populateListView().execute(songs.toArray(new Song[songs.size()]));
adapter =new SongAdapter(this,R.layout.list_item1, songs.toArray(new Song[songs.size()]));
setListAdapter(adapter);
}


.

stackoverflow.comm

[General] Samsung Galacy s3 werid symbol?


Okay im new here and i got a s3 for my christmas present but recently a werid android symbol is poping up every so often, its like a one eyed android head, what is it and what doea it mean ?



.

forum.xda-developers.com

[General] rooted slll


Hello everyone I am new here and I have a question. I have just used odin to flash clockwork mod to my slll and then I booted up into cm mode and flashed clockwork mod to the phone, the next step was to install busybox then superuser to run the bianary. Busy box say tha it does not have root access. Please tell me what to do now...



.

forum.xda-developers.com

[General] Storage menu in Settings never stops Calculating


Hello, I just bought a Huawei Y300 (Jelly Bean) a couple of days ago. Initially I would open the Storage menu in the Settings and it would show the actual amounts of memory available for apps, videos etc. Then a few hours later it started getting stuck on "calculating..." and never displayed the results anymore. I restarted the phone (or powercycled it, not sure anymore) and it displayed the results again, but only for a short while. A bit later the problem appeared again and I haven't been able to get it to work since.I haven't really done much with the phone - installed Nova Launcher and some apps and games etc., but no rooting or full backups or whatnot.

Right now it shows Phone Storage - 4GB total, Total Space - 14.81GB and all the subunits there (Apps, Pictures, videos, Downloads...) only show Calculating... Only the last item in that subsection, "Available", shows the actual amount - 14.38GB. If I open the "App Info" for any app, the storage information there also doesn't work - Total, App, Data all show Computing... and stay that way. Probably because of that the Clear Data button here is always greyed out so I can't clear it for any apps.

Anyone have any idea what the problem might be? I tried searching on the Internet but didn't find anything about this problem. If nothing else helps I'll try a factory reset, but I'd rather not have to install all my apps and enter all contacts again so I hope someone has some suggestion.



.

forum.xda-developers.com

[android help] Android format a UTC datetime string into local format throws null error


hi I have the method below which takes the value of a UTC datetime string, format it to local display and return:



public static String convertDateStringUTCToLocal(String sourceUtcDateTimeString)
{
SimpleDateFormat simpleDataFormat = new SimpleDateFormat();
simpleDataFormat.setTimeZone(getCurrentTimeZone());
String outputUTCDateTimeString = simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0)).toString();

return outputUTCDateTimeString;
}

public static TimeZone getCurrentTimeZone()
{
Calendar calendar = Calendar.getInstance();
TimeZone outputTimeZone = calendar.getTimeZone();

return outputTimeZone;
}


When debugging, the value of parameter sourceUtcDateTimeString is 'Mon Apr 15 13:54:00 GMT 2013', I found that 'simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0))' gives me 'null', and 'simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0)).toString()' throws error "java.lang.NullPointerException at toString()".


Looks like there is nothing at ParsePosition(0), but I am really new to Android dev, no idea why this is happening and how to get around it, could any one help out with a fix? I got stuck on this issue for hours.


thanks in advance.



.

stackoverflow.comm

[android help] Android format a UTC datetime string into local format throws null error


hi I have the method below which takes the value of a UTC datetime string, format it to local display and return:



public static String convertDateStringUTCToLocal(String sourceUtcDateTimeString)
{
SimpleDateFormat simpleDataFormat = new SimpleDateFormat();
simpleDataFormat.setTimeZone(getCurrentTimeZone());
String outputUTCDateTimeString = simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0)).toString();

return outputUTCDateTimeString;
}

public static TimeZone getCurrentTimeZone()
{
Calendar calendar = Calendar.getInstance();
TimeZone outputTimeZone = calendar.getTimeZone();

return outputTimeZone;
}


When debugging, the value of parameter sourceUtcDateTimeString is 'Mon Apr 15 13:54:00 GMT 2013', I found that 'simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0))' gives me 'null', and 'simpleDataFormat.parse(sourceUtcDateTimeString, new ParsePosition(0)).toString()' throws error "java.lang.NullPointerException at toString()".


Looks like there is nothing at ParsePosition(0), but I am really new to Android dev, no idea why this is happening and how to get around it, could any one help out with a fix? I got stuck on this issue for hours.


thanks in advance.



.

stackoverflow.comm

[android help] How to add a Map to an Action Bar tab in Android/Eclipse?

How to add a Map to an Action Bar tab in Android/Eclipse? - Stack Overflow



















I have a Map class in an Android App that shows your location, and works fine on its own. However, I am trying to add the class as a tab to my Action Bar in another app and am having difficulties. Since the class extends 'MapActivity', it is getting a Bound Mismatch error with my TabListener as it needs a class that extends Fragment. I have seen MapFragment before, but it just says it cant be resolved to a type. Perhaps that is because I am using API 17, but I am just so confused now. Should I be doing something different than setting my Map class as a TabListener like I did with my other Tabs? Is there another way to get your location and display it in a Map from the click of the Tab? Any help would be appreciated, and as always thanks for reading!


Drew
















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










default






.

stackoverflow.comm

[android help] Read only the specific categories from the RSS Feed list


I'm trying to learn how to make RSS Reader for my android app by following this tutorial. The feed is generated from a wordpress blog and I want to figure out a way to read by categories. It's currently reading the entire feed items but I'm trying to sort out specific categories from the list. I'm new to android and java programming and please help kindly, and please let me know if I need to update my question for clarification.


This is how the XML Looks like and I want to pull the FeatureStory1, FeatureStory2, FeatureStory3 and so on..


Thank you for reading.




..




..
..



..




..
..



..




..
..



This is the Activity class to read the feed.



// Connected - Start parsing
new AsyncLoadXMLFeed().execute();

}

}

private void startLisActivity(RSSFeed feed) {

Bundle bundle = new Bundle();
bundle.putSerializable("feed", feed);

// launch List activity
Intent intent = new Intent(SplashActivity.this, GridActivity.class);
intent.putExtras(bundle);
startActivity(intent);

// kill this activity
finish();

}

private class AsyncLoadXMLFeed extends AsyncTask {

@Override
protected Void doInBackground(Void... params) {

// Obtain feed
DOMParser myParser = new DOMParser();
feed = myParser.parseXml(http://mywordpressblog.com/feed/);
if (feed != null && feed.getItemCount() > 0)
WriteFeed(feed);
return null;
}

@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);

startLisActivity(feed);
}

}

// Method to write the feed to the File
private void WriteFeed(RSSFeed data) {

FileOutputStream fOut = null;
ObjectOutputStream osw = null;

try {
fOut = openFileOutput(fileName, MODE_PRIVATE);
osw = new ObjectOutputStream(fOut);
osw.writeObject(data);
osw.flush();
}

catch (Exception e) {
e.printStackTrace();
}

finally {
try {
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

// Method to read the feed from the File
private RSSFeed ReadFeed(String fName) {

FileInputStream fIn = null;
ObjectInputStream isr = null;

RSSFeed _feed = null;
File feedFile = getBaseContext().getFileStreamPath(fileName);
if (!feedFile.exists())
return null;

try {
fIn = openFileInput(fName);
isr = new ObjectInputStream(fIn);

_feed = (RSSFeed) isr.readObject();
}

catch (Exception e) {
e.printStackTrace();
}

finally {
try {
fIn.close();
} catch (IOException e) {
e.printStackTrace();
}
}

return _feed;

}


This is the DOMParser class



try {
// Create required instances
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();

// Parse the xml
Document doc = db.parse(new InputSource(url.openStream()));
doc.getDocumentElement().normalize();

// Get all tags.
NodeList nl = doc.getElementsByTagName("item");
int length = nl.getLength();

for (int i = 0; i < length; i++) {
Node currentNode = nl.item(i);
RSSItem _item = new RSSItem();

NodeList nchild = currentNode.getChildNodes();
int clength = nchild.getLength();

// Get the required elements from each Item
for (int j = 1; j < clength; j = j + 2) {

Node thisNode = nchild.item(j);
String theString = null;
String nodeName = thisNode.getNodeName();

theString = nchild.item(j).getFirstChild().getNodeValue();

if (theString != null) {
if ("title".equals(nodeName)) {
// Node name is equals to 'title' so set the Node
// value to the Title in the RSSItem.
_item.setTitle(theString);
}

else if ("content:encoded".equals(nodeName)) {
_item.setDescription(theString);

// Parse the html description to get the image url
String html = theString;
org.jsoup.nodes.Document docHtml = Jsoup
.parse(html);
Elements imgEle = docHtml.select("img");
_item.setImage(imgEle.attr("src"));
}

else if ("pubDate".equals(nodeName)) {

// We replace the plus and zero's in the date with
// empty string
String formatedDate = theString.replace(" +0000",
"");
_item.setDate(formatedDate);
}

}
}


.

stackoverflow.comm

[android help] Dynamically incresing the no of lines in editText

java - Dynamically incresing the no of lines in editText - Stack Overflow



















I have a layout with an editText field.I have to fit a large amount of data by default in the text box while loading it initially. Since i fit the data dynamically onCreate i dont know the size of the data initially. Can somebody tell me how can i increase the height of the editText field(Include multiple lines on large data) dynamically?



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

android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="About me :"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/dboard_classwall_txt_color" />

android:id="@+id/text_about_me"
android:layout_width="match_parent"
android:layout_height="34dp"
android:background="@drawable/editbox_profile_bg"
android:gravity="center_vertical"
android:imeOptions="actionNext"
android:inputType="textPostalAddress"
android:maxLength="@integer/roster_max_contact_details_length"
android:minHeight="50dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:singleLine="true"
android:textColor="@android:color/black"
android:textColorHint="@color/edit_prof_editbox_txt_color"
android:textCursorDrawable="@null" >





























I think you should use



android:id="@+id/text_about_me"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/editbox_profile_bg"
android:gravity="center_vertical"
android:imeOptions="actionNext"
android:inputType="textPostalAddress"
android:minHeight="50dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:singleLine="false"
android:textColor="@android:color/black"
android:textColorHint="@color/edit_prof_editbox_txt_color"
android:textCursorDrawable="@null" >


instead hope it helps























Just do this:


android:layout_height="34dp" => android:layout_height="wrap_content"
android:singleLine="true" => android:singleLine="false"


Regards




















lang-java






.

stackoverflow.comm

[android help] SKU not available for in app purchase during testing

android - SKU not available for in app purchase during testing - Stack Overflow



















I am adding in-app-billing to one of my existing apps. To test this I created a draft app in google play, uploaded the new version of the apk with in-app-billing and added a product. I activated this product but I did not publish this new test app.


But while testing, on querying for the newly created SKU, the code can't find it. Will I have to publish my app for this to work? Am I doing something wrong here?


EDIT: I am using IABv3.



















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










default






.

stackoverflow.comm

[android help] How can I fetch all tweets from a particuler user and place them in my Android layout?

twitter - How can I fetch all tweets from a particuler user and place them in my Android layout? - Stack Overflow



















I am able to fetch the last tweet by a particular user and place that in my Android layout. However, I need to fetch all tweets by that user and display them in the layout.


Here is my code so far:



httpClient = new DefaultHttpClient();
tweetList = (TextView) findViewById(R.id.tvTweet);
new ReadJSON().execute("text");

public org.json.JSONObject alltweets(String username) throws ClientProtocolException, IOException, JSONException {
StringBuilder sb = new StringBuilder(URL);
sb.append(username);
HttpGet get = new HttpGet(sb.toString());
HttpResponse response = httpClient.execute(get);
int statuss = response.getStatusLine().getStatusCode();
if (statuss == 200) {
int i;
HttpEntity e = response.getEntity();
String data = EntityUtils.toString(e);
JSONArray timeline = new JSONArray(data);
for (i=0; i alltweets = timeline.getJSONObject(i);
Log.i("tweet", timeline.getJSONObject(i) + "");
}
return alltweets;
} else {
return null;
}
}

public class ReadJSON extends AsyncTask {
@Override
protected String doInBackground(String...params) {
// TODO Auto-generated method stub
try {
json = alltweets("username"); //particular user name from which page you want to fetch tweets
return json.getString("text");
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
Log.i("tweet is ", result);
tweetList.setText(result);
}
}


















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










default






.

stackoverflow.comm

[General] applications launcher


hi. am having problems with my chinese s3 19300. it shows application launcher(process.com skymobi touchwiz) whenever i try to acess the apps. what could be the problem and how do i fix it. the phone even blacks out. thank.



.

forum.xda-developers.com

[General] How to edit Kernel for changing CPU frequencies?


My Xperia Tipo Dual always freezes or reboots, the moment when the processor is clocked at 245 MHz (by the governor). Don't know why. Tried everything possible.
I'm running stock ROM and stock Kernel and the latest firmware.

The following frequencies are supported (in MHz): 122, 245, 320, 480, 640, 800. The moment the governor scales the CPU to 245 at low load, the phone either freezes, or reboots. If I manually put it to 245 MHz, the same thing happens within a few seconds.

So, I'm running at Minimum = 320 MHz; Maximum = 800 MHz with the interactive governor. Now it runs perfectly stable. But the standby time is considerably reduced.

Is there a way, by which I can delete the 245 MHz frequency from the Kernel and let the governor scale from 122 to 320 to 480 and so on; instead of 122 to 245 to 320 to 480 and so on?

Is there a way? Thank you.



.

forum.xda-developers.com

[General] Samsung galaxy exhilarate won't vibrate


My phone won't vibrate for texts or apps. I have it on silent mode but the vibration always option is turned on. This setting has always worked before today. I've tried turning it on and off but that didn't do anything. Help?



.

forum.xda-developers.com

[General] I'm at home but Google now thinks I'm not


Anyone knows how to remove a suggested place by Google Now? I'm getting really frustrated because I never know what's the real ETA from wherever I am to my actual home because google now keeps suggesting me a place I haven't really been to, I've passed by that place because it is on my way to almost everywhere I go but I've never actually stayed more than 2 seconds there. What the heezy?



.

forum.xda-developers.com

[General] Amazon MP3 April 5th update makes songs saved on the device "buffer" every second while playing?


Can anyone update their Amazon MP3 app and try to play a song saved on the device to see if the play button gets replaced with a buffer wheel every second or two? It also has not so smooth playback. I kept uninstalling the update and reinstalling it to see if it was the update's fault and it seems that's the case.



.

forum.xda-developers.com

[android help] How to register the new user through JSON in android?

How to register the new user through JSON in android? - Stack Overflow




















here json response is,



[{"userid":"1","username":"","firstname":"","lastname":"","email":"","password":""}]


Thanks in adavance url is,



http://aleedex.biz/game/users.php?action=new

























Please check this You can find a detailed note there























here you need to pass your Require parameter with List params



public class JSONParser {

static InputStream is = null;
static JSONObject jObj = null;
static String json = "";

// constructor
public JSONParser() {

}

public JSONObject getJSONFromUrl(String url, List params) {

// Making HTTP request
try {
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));

HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();

} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "n");
}
is.close();
json = sb.toString();
Log.e("JSON", json);
} catch (Exception e) {
Log.e("Buffer Error", "Error converting result " + e.toString());
}

// try parse the string to a JSON object
try {
jObj = new JSONObject(json);
} catch (JSONException e) {
Log.e("JSON Parser", "Error parsing data " + e.toString());
}

// return JSON String
return jObj;

}
}






















default







.

stackoverflow.comm

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...