Tuesday, April 16, 2013

[android help] How to show devider in listview when there is only single item present

android - How to show devider in listview when there is only single item present - Stack Overflow







Tell me more ×

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

















I have a listview but it only shows devider between two items , i have a case where i have to show devider when there is only single item present or only few items are present that do not fill the whole page , In such case no devider appears on last item that & looks weird. Footerview can not help as deviders images are indiapendant from phone to phone . Can any one help ?
















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










default






.

stackoverflow.comm

[android help] Sending data from android app to server(database) [closed]

java - Sending data from android app to server(database) - 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 creating a shopping mall application for Android, in which I need to communicate with the remote server(database). I am able to retrieve data from the server using a JSON parser, but I don't know how to send data from the app back to the server(database). Can anyone help me with the solution, as I'm new to Android development.



















It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.















You really should try something before asking.


If you are retrieving data in JSON format, you should try to send it in JSON too. One way is to use some HTTP client to connect to web server.


Another question worth reading: Send data from android to server via JSON

















default






.

stackoverflow.comm

[android help] ClassCastException error, dont know why it occurs

java - ClassCastException error, dont know why it occurs - 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 working with BaseAdapter class and i get an ClassCastException error in getView method when i try to cast my viewHolder class.


Here is my code:



public View getView(int position, View convertView, ViewGroup parent){
// TODO Auto-generated method stub
NoteItem noteItem = list.get(position);
TextView tv;
LinearLayout ll;
if(convertView == null){
convertView = inflater.inflate(R.layout.dialog_listitem_note, null);
ll = (LinearLayout) convertView.findViewById(R.id.llNote);
tv = (TextView) convertView.findViewById(R.id.tvNoteItem);
convertView.setTag(new NoteItemViewHolder(tv, ll));
ll.setOnClickListener(new OnClickListener(){...});
}else{
NoteItemViewHolder viewHolder = (NoteItemViewHolder) convertView.getTag(); //ClassCastException error here
ll = viewHolder.getLl();
tv = viewHolder.getName();
}
tv.setText(noteItem.getName());
ll.setTag(noteItem);
...
return convertView;
}

private class NoteItemViewHolder{

TextView name;
LinearLayout ll;

public NoteItemViewHolder(TextView name, LinearLayout ll){
this.name = name;
this.ll = ll;
}

public TextView getName(){
return name;
}

public LinearLayout getLl(){
return ll;
}
}


Dont get why this error occurs, please help.


























getView method should Like below and Also Check Your Control Like LinearLayout is bind with R.id.yourLinearID



public View getView(int position, View view, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder;
if(view == null)
{
view = inflater.inflate(R.layout.checkin_item, null);
holder = new ViewHolder();

holder.iconImage = (ImageView)view.findViewById(R.id.chkin_item_iv);
holder.placeName = (TextView)view.findViewById(R.id.chkin_item_tv_name);
holder.placeAddress = (TextView)view.findViewById(R.id.chkin_item_tv_address);
holder.placeKm = (TextView)view.findViewById(R.id.chkin_item_tv_0);

view.setTag(holder);
}
else
{
holder = (ViewHolder)view.getTag();
}

try

if(googleSetGetArray.getGoogleSetGets().get(position).getName().length() != 0)
{
holder.placeName.setText(googleSetGetArray.getGoogleSetGets().get(position).getName());
}
else
{
holder.placeName.setText(mContext.getString(R.string.mfitem_lbl_namenotpresent));
}
if(googleSetGetArray.getGoogleSetGets().get(position).getVicinity() != null && googleSetGetArray.getGoogleSetGets().get(position).getVicinity().length() != 0)
{
holder.placeAddress.setText(googleSetGetArray.getGoogleSetGets().get(position).getVicinity());
}
else
{
holder.placeAddress.setText(mContext.getString(R.string.mfitem_lbl_addressnotpresent));
}
if(googleSetGetArray.getGoogleSetGets().get(position).getDistance() != 0.0f)
{
holder.placeKm.setText(Float.toString(googleSetGetArray.getGoogleSetGets().get(position).getDistance()));
}
else
{
holder.placeKm.setText(Float.toString(0.0f));
}
}catch(Exception ex)
{
ex.printStackTrace();
}


imageLoader.DisplayImage(data[position], holder.iconImage);
return view;
}

class ViewHolder
{
ImageView iconImage;
TextView placeName;
TextView placeAddress;
TextView placeKm;

}






















lang-java






.

stackoverflow.comm

[General] N7 now won't go online?


Hi.
New to this.
I've had a Nexus 7 for a few weeks and all seemed ok.
But now it won't go online - it used to.
It does the Google Search thing, but anything clicked on the eventual list only takes me to a blank page.
Do I need to factory reset?
Or is there something else?
(utube items if clicked show up immediately by the way) ????
Puzz



.

forum.xda-developers.com

[android help] xmlpullparser exception while trying to consume a method

android - xmlpullparser exception while trying to consume a 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 am trying to consume webservice method using ksaop2.


here is the code



try {

SOAP_ACTION = NAMESPACE + METHOD;

SoapObject request = new SoapObject(NAMESPACE, METHOD);

SoapSerializationEnvelope res = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
res.dotNet = true;
res.setOutputSoapObject(request);

HttpTransportSE call = new HttpTransportSE(url);

SoapPrimitive result;
call.call(SOAP_ACTION, res);
result = (SoapPrimitive) res.getResponse();

ParseLocations Objparsecities = new ParseLocations(
new ByteArrayInputStream(result.toString()
.getBytes("UTF-8")));
lstresponse = Objparsecities.parse();

System.out.println(lstresponse);

} catch (SoapFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


it works fine on emulator but when i try to run on my device i am getting the following error



04-16 15:54:11.761: W/System.err(3982): org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@405f2fe8)
04-16 15:54:11.761: W/System.err(3982): at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
04-16 15:54:11.761: W/System.err(3982): at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1413)
04-16 15:54:11.761: W/System.err(3982): at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)
04-16 15:54:11.761: W/System.err(3982): at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
04-16 15:54:11.761: W/System.err(3982): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
04-16 15:54:11.761: W/System.err(3982): at com.netserv.Pungry.LocationbyCities.SendRequesttoServer(LocationbyCities.java:249)
04-16 15:54:11.761: W/System.err(3982): at com.netserv.Pungry.LocationbyCities$CityData.doInBackground(LocationbyCities.java:216)
04-16 15:54:11.761: W/System.err(3982): at com.netserv.Pungry.LocationbyCities$CityData.doInBackground(LocationbyCities.java:1)
04-16 15:54:11.761: W/System.err(3982): at android.os.AsyncTask$2.call(AsyncTask.java:185)
04-16 15:54:11.761: W/System.err(3982): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
04-16 15:54:11.761: W/System.err(3982): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
04-16 15:54:11.761: W/System.err(3982): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
04-16 15:54:11.761: W/System.err(3982): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
04-16 15:54:11.761: W/System.err(3982): at java.lang.Thread.run(Thread.java:1027)
04-16 15:54:11.771: W/System.err(3982): java.lang.NullPointerException
04-16 15:54:11.771: W/System.err(3982): at com.netserv.Pungry.LocationbyCities$CityData.onPostExecute(LocationbyCities.java:202)
04-16 15:54:11.771: W/System.err(3982): at com.netserv.Pungry.LocationbyCities$CityData.onPostExecute(LocationbyCities.java:1)
04-16 15:54:11.771: W/System.err(3982): at android.os.AsyncTask.finish(AsyncTask.java:417)
04-16 15:54:11.771: W/System.err(3982): at android.os.AsyncTask.access$300(AsyncTask.java:127)
04-16 15:54:11.771: W/System.err(3982): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
04-16 15:54:11.771: W/System.err(3982): at android.os.Handler.dispatchMessage(Handler.java:99)
04-16 15:54:11.771: W/System.err(3982): at android.os.Looper.loop(Looper.java:150)
04-16 15:54:11.771: W/System.err(3982): at android.app.ActivityThread.main(ActivityThread.java:4263)
04-16 15:54:11.771: W/System.err(3982): at java.lang.reflect.Method.invokeNative(Native Method)
04-16 15:54:11.771: W/System.err(3982): at java.lang.reflect.Method.invoke(Method.java:507)
04-16 15:54:11.771: W/System.err(3982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-16 15:54:11.771: W/System.err(3982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-16 15:54:11.781: W/System.err(3982): at dalvik.system.NativeStart.main(Native Method)


Can i know what is the mistake?


Thanks:)
















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










default






.

stackoverflow.comm

[android help] Html parsing text from TD Tag

java - Html parsing text from TD Tag - 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 my Html data











Archive Url
http://www.toradio.com/prgramdetails/20130413_vali_mm.mp3



I want to get mp3 url(http://www.toradio.com/prgramdetails/20130413_vali_mm.mp3) from above html text


I'm following this link,Is it Correct or any better way to parse this text Could any one help?



























just write



link























Check out JSoup. It's a nice HTML Parser for JAVA.




















lang-java






.

stackoverflow.comm

[android help] Android listview adapter with button


I have a problem with my Android application which I'm developing in C#. I have a ListActivity and an ArrayAdapter and inside ListActivity i have custom views with a TextView and a Button. This button should start new activities, get the results from the activities (mostly text inputs), and do something in the background, and then update the TextView's text.


I'm using ViewHolder pattern in the ArrayAdapter, and Command Pattern for the background operations.


My problem is that I can't find a way how to update the TextViews inside ArrayAdapter, since I have the results of the activities in the ListActivity. I tried to create an event in ListActivity and subscribed to it inside ArrayAdapter but I think it is not an optimal solution to this problem.


Could you suggest something better implementation to this problem?


Thanks in advance!



.

stackoverflow.comm

[General] Exchange login failure with new phone seems to have corrupted my exchange account


I had a Galaxy S3 (4.1.2) working fine on exchange server 2003.

I broke the screen and replaced it with a Droid Razr Maxx HD (also 4.1.2) . I set-up the corporate exchange email account following normal procedures. It accepted everything using manual set-up, started syncing the exchange account (up to April 5th) then it started coming up with a incorrect username or password error. I verified the password and tried again until my exchange account locked me out.

I called IT, they verified username, password and server settings. unlocked my account, and I attempted to login in again 3 times unsuccessfully until it again locked me out. Rinse and repeat. If I factory reset the phone and unlock my exchange account, it will again initially work and start to sync, then go back to the same error.

They created a new user account for me as a test. Everything works fine on the new account. They are reluctant to delete my current exchange account and move me to another one because I work for a local government agency and all my activity is discoverable under the freedom of information act and this would greatly complicate things.

I tried to go back to my broken SIII, an now it will not log on to my exchange account either. Same username and password error as Razr Maxx HD.

I also grabbed a spare phone, a Samsung stratosphere (2.3.6) and my HP Touchpad runnning CM9 Tenderloin and both log on to my exchange account just fine.

Verizon says everything is provisioned correctly, that it is an exchange problem. My IT says nothing has changed at the exchange server and that my current account and the test account have the same settings.
HELP!



.

forum.xda-developers.com

[General] Best talk to text app


Suggestions for a text app that lets you speak your text instead of typing please. Thanks!!! Rita

Sent from my SAMSUNG-SGH-I317 using Android Central Forums



.

forum.xda-developers.com

[General] Best phone for listening to music?


My razr is terrible for listening to music, i end up using my ipod instead. Are there any phones that would be as good in sound quality as an ipod?

Sent from my DROID RAZR using Android Central Forums



.

forum.xda-developers.com

[General] Huawei G330d dual sim, how do I install UK google version ?


Hi, i'm new to this so please bear with me....

I've just purchased a Huawei G330d dual sim phone via a website buysku in china, I specified when ordering that I wanted the uk version of android market/apps/googler play...etc to which they agreed they would do...but guess what...? It's got the chineese version of android !

How can I uninstall it and re-install with the uk version ?

many thanks in advance for your help

p.s, phone is unlocked, language changed to english (usa) and has version 4.04 installed



.

forum.xda-developers.com

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