Sending Datagram Crashes Without Exception

May 12, 2012

I have developed a simple UDP connection protocol in C++ that I am currently using fine on windows machines. I want to proceed to develop a java client class for use in android applications.

Everything seems to be simple enough (except for eclipse constantly bugging out) but I appear to have hit a brick wall. Here is the code that I run when a button is pressed (all I want at this stage is to get a packet through):

Code:
DatagramPacket sendPacket = new DatagramPacket("HELLO!".getBytes(), 6, servAddr, server_port);
Log.d("UdpTest", "blah");
try {
Log.d("UdpTest", "blah2");
servSock.send(sendPacket);

[Code] ....

I am trying to catch the exception, so I am not sure how it is uncaught. This is practically my first attempt at Java so I could be mistaken in that the uncaught exception is not my problem and is just mentioned because of however Android is deciding to fail on the send() method.

The only permission my app should require is android.permission.INTERNET is it not? Oddly, if I remove the permission the app crashes in exactly the same way which would suggest to me that it needs some other permission, the permissions are not applying correctly or that the problem has nothing to do with permissions (it is failing before it gets far enough to care).

So far, I think it could be a strange ICS problem, but that wouldn't make sense because I haven't seen any other app that is likely to use UDP simply stop responding on my phone (edit: I have actually, see my next post). The other alternative is that my Java is just horribly wrong (i hope so).

Here is my code:

Code:
public class UdpTestActivity extends Activity {
String text;
int server_port = 25505;
byte[] message = new byte[3000];
DatagramSocket servSock;

[Code] ....

Sending datagram crashes without exception


Android :: Launch My App - It Crashes With OutOfMemory Exception

Aug 24, 2010

I have an Android app that in the onCreate() method, preloads a lot of graphics.

When I test my app on my HTC Aria and launch it, it runs fine. However, if I press the back button to exit my app, and then launch the app again, it crashes with an OutOfMemoryError: bitmap size exceeds VM budget. If I then launch the app for the third time (right after it has crashed) it launches fine. Then if I close and re-launch it, it crashes again with out of memory. It continues this every-other-time-crashing pattern forever if I keep trying.

I checked to see what life cycle methods were being called and onStop() and onDestroy() are both being called when I exit the app, yet I have a feeling that something is not yet being cleaned up and that by "crashing" the app when I try to launch it the second time, it somehow free's the memory.

Any thoughts on what could be happening or how to remedy this? Please let me know if you need me to post more info.

Info: My app is fairly simple and only has 1 activity that plays some frame animations.

View 3 Replies View Related

Datagram Socket Android Game

Sep 20, 2012

I'm trying to develop multiplayer game , like any usual games join to room game then the score of game sharing with another player. After I'm searching in Google , what i see i should be start on DatagramSocket , in this link URL..., i can create my WiFi internet game throwing DatagramSocket or i need something else.

View 1 Replies View Related

Android Datagram Sockets Not Working?

Sep 24, 2013

I am trying to implement basic Datagram Sockets in Android. I am starting with one of the samples available on the web:

Code:
String messageStr="Hello Android!";
int server_port = 54372;
try {
[code].....

The program dies when it hits the s.send(p) command.

View 2 Replies View Related

Android :: Activity Crashes When Remote Service Crashes

Jul 16, 2010

I'm trying to understand remote services at the moment and everything works fine, i can start the service and know how to communicate with it through the AIDL-interface. My problem is that the service seems to still run in the same process like the activity it was started from, because the activity crashes too, if there is an error thrown in the Service.

I set the service process to remote ( android:process=":remote" ) so what am i doing wrong? Or what do i have to do to unbind the service-process completely from the activity-process?

View 1 Replies View Related

Android :: Sqlite Exception:java.lang.Illegal Argument Exception Column Id Does Not Exist

Jul 14, 2010

I created a sql lite database with the following columns:
static final String dbName="demoDB";
static final String tableName="Employees";
static final String colID="EmployeeID";
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREATE TABLE "+tableName+" ("+colID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+
colName+" TEXT, "+colAge+" Integer);");
I want to select all the records in the database like this and display them in a gridview:SQLiteDatabase db=this.getWritableDatabase();Cursor cur= db.rawQuery("Select "+colName+", "+colAge+" from "+tableName, new String [] {});String [] from=new String []{DatabaseHelper.colName,DatabaseHelper.colAge};
int [] to=new int [] {R.id.colName,R.id.colAge};
SimpleCursorAdapter sca=new SimpleCursorAdapter(this,R.layout.gridrow,c,from,to);
GridView grid=(GridView)findViewById(R.id.grid);
grid.setAdapter(sca);but i receive the following exception:java.lang.IllegalArgumentException: column '_id' does not exist.the db table does not have a column with name '_id'so what is wrong with this code

View 3 Replies View Related

HTC Desire :: Sending Text - Can't Figure Out If Sending A Message Via Facebook Or To Mobile Number

Jun 24, 2010

I have a friend who is added to my Desire's contact list.

1. He is on my Facebook contact. (His facebook pic appears in my Desire contact list)
2. He is my Gmail contact as well.
3. He is added as a 'Phone Contact' as well.

I sent him a text few days ago but don't remember if it was using facebook or my phone (network provider sms) but now when I go in to 'Messages' and send him a message, I just can't figure out if I am sending him a message via Facebook or to his mobile number.

View 1 Replies View Related

LG Eve :: GW620 Crashes

Jul 11, 2010

Phone is less than 48 hours old

It would have been taken back already if the store wasn't in such a remote place!

Phone will either hang at the LG splash screen requiring a battery pull or if it does manage to boot in it will freeze up after a few minutes use.

Occasionaly getting error messages, google. something and android.exe I think aswell.

Is it possible that the android installation is corrupt and is there a way to manually reinstall it ?

I've tried a factory reset and also managed to keep the phone running long enough to update the firmware via the LG update tool.... No joy with either!

View 2 Replies View Related

App Crashes When It Starts

Sep 24, 2012

whenever i start this app it crashes after about 5 seconds. I am quite desperate because I couldnt find the error/ mistake yet.

Code:
package de.example.adorassprachausgabe;
import java.util.Locale;
import android.os.Bundle;
import android.app.Activity;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View.OnClickListener;
import android.widget.Button;

[code]....

View 1 Replies View Related

HTC EVO 4G :: Camera App Crashes With Too Many Apps

Jun 7, 2010

Got the Evo (first android phone for me) and promptly started installing apps. At some point, my camera stopped working. When launching the camera app, the screen would go black for a second, then back to home screen. Installed the OTA update (also had the security error on SD card), then installed apps again. Same problem after so many apps installed. I don't know the app limit, but it's not out of internal storage. If I uninstall enough apps, camera works again. All other apps worked normally throughout.

View 11 Replies View Related

HTC Incredible :: 4th - Reboots - Crashes

Jul 23, 2010

my first 2 rebooted about 5 times a day. my 3rd one i did the leaked ota right when i got it and it was freaking awesome. Except the speaker was crackling like it was blown. Now my 4th one is rebooting by itself. I'm tempted to do the leaked ota and see if that fixes it.

View 26 Replies View Related

Android :: Default_all Crashes App

Feb 9, 2009

I've been using:

Notification.DEFAULT_SOUND

for quite some time with great success. When I replace that with:

Notification.DEFAULT_ALL

the program crashes when the notification is called.

View 4 Replies View Related

Android :: App Crashes Only On Device

Apr 22, 2010

So i have a app that runs fine on the emulator but crashes (force close message as soon as i open the app) on every device i have tested it on. How can i see whats going on? what could be going on?

View 4 Replies View Related

Android :: ListActivity In Tab Crashes

Oct 26, 2009

I'm trying to create an application that has 3 tabs. Under the middle tab should be a ListView. It starts up fine (on the left tab) but when I click the middle tab it crashes.

The other two tabs are static data specified in the main.xml file. But the middle tab, I try to create dynamically. Here's the code from the main onCreate function:

CODE:...............

Instead I appear to get an exception:

CODE:...............

ContactListActivity is defined this way:

public class ContactListActivity extends ListActivity { ...

I get the feeling that I'm supposed to create the Intent with something like Intent.ACTION_VIEW but this is where I get lost. If this is the problem, I could try stuff until it works, but I'd prefer to understand why.

Or is ContactListActivity supposed to override something ?

View 2 Replies View Related

Android :: Webview Crashes

Sep 20, 2009

I'm getting fairly regular crashes using WebView's in the underlying C code (sigsegv's). There isn't a _whole_ lot of rhyme or reason to it, but one thing that is somewhat suspicious is that I have more than one webview active (only one is one the screen at any one time, but if this has anything to do with my problem it may not matter since it appears that webkit widgets run asynchronously from the main UI thread).

Here's the stack dump. I've looked through the archives and it appears that there are other dumps, but it's really hard to tell from my vantagepoint whether they have anything to do with one another.

This is pretty easily reproducible (especially with one particular url of mine) so it should be relatively easy to track down.

CODE:.................

View 3 Replies View Related

HTC Incredible :: Market Crashes After OTA

Nov 17, 2010

Ever since the OTA update everytime I go to update an app or install a new one it goes to download and I get a force close everytime. When I click back on the market its like 50/50 if its actually still downloading/installing the app. Otherwise it'll just forceclose again when I retry to download it. Nothing else on my phone broke from the update but this is kinda bugging me..

View 7 Replies View Related

Android :: SurfaceView On G1 - Crashes

Apr 30, 2009

I am finally testing my application on a G1 and even though it works fine on the emulator, it crashes on the G1

It crashes when it does:

CODE:.........

And the view is defined like this:

CODE:..............

View 3 Replies View Related

App Crashes After Splash Screen?

Apr 1, 2013

I made a application that adds by 10's and i decided for the first time to make a splash screen.For some reason the app crashes after the Splash screen.Idk if the problem is with the manifest or the java code.

Starting point.Java

PHP Code:

package com.example.counter;import android.os.Bundle;import android.app.Activity;import android.view.Menu;import android.view.View;import android.widget.Button;import android.widget.TextView;public class Startingpoint extends Activity {    int counter;    Button add, sub;    TextView di

[Code]....

View 6 Replies View Related

Declaring Items Causes Crashes?

Dec 7, 2012

I am trying to build a game called 'spam' where you hit the button as much as possible in the given time. however, in the game class, it will run fine if I dont declare the actual spam button and the textviews that I want to change (score and time left).

I am using

Quote:

findViewById(R.id.theid);

When I dont declare it ,ie: I DONT put

Quote:

spambutton = (Button) findViewById(R.id.gameSpamButton);

, it runs fine - it is just static and wont do anything.

But as soon as I try declare anything (the spam button or the time left text view or the score text view), when I try to start the activity (via the Intent), it says that Quote:

the application test (com.example.test) has stopped unexpectedly. try again

I am using Eclipse Version: 3.7.1 Build id: M20110909-1335. I am running Windows 7 Home Premium 64Bit, 8GB RAM, 1GB GDDR5 GTS 450 GeForce graphics card, Asus P8 motherboard, 2TB Samsung HDD, 500GB Samsung HDD, standard 16x optical drive, 5 fans, quad core i5 3.10GHz CPU.

This is my code for the class so far, and it crashes with the above error:

Quote:

package com.example.test;
import android.app.Activity;
import android.os.Bundle;

[Code]....

View 3 Replies View Related

Android :: What Home Replacement Crashes The Least

Jan 15, 2010

I use to love Home ++ but lately its been crashing like crazy. I was gonna try GDE but I read some of the comments and that seems to have crashing issues also. Im tired of all the force closes. I have one widget and Im only using five home screens. Why is it closing so much

View 9 Replies View Related

Android :: Application Crashes Before It Starts

Nov 16, 2010

intentTest.java:
package intentTest.xyz.com;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button
public class intentTest extends Activity {
Button b;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b = (Button) findViewById(R.id.b);
b.setOnClickListener( new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(intentTest.this,seond.class );
startActivity(intent);
}});
}}
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="First screen"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="click"
android:name="@+id/b"
/>
</LinearLayout>
seond.java:
package intentTest.xyz.com;
import android.app.Activity;
import android.os.Bundle;
public class seond extends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
} }
second.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="second screen"
/>

manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="intentTest.xyz.com"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".intentTest"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".seond"></activity>
</application>
</manifest>

I get the following error code:
11-16 01:26:07.156: ERROR/AndroidRuntime(779): Uncaught handler: thread main exiting due to uncaught exception
11-16 01:26:07.166: ERROR/AndroidRuntime(779): java.lang.RuntimeException: Unable to start activity ComponentInfo{intentTest.xyz.com/intentTest.xyz.com.intentTest}: java.lang.NullPointerException
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.access$2100(ActivityThread.java:116)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.os.Looper.loop(Looper.java:123)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.main(ActivityThread.java:4203)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at java.lang.reflect.Method.invokeNative(Native Method)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at java.lang.reflect.Method.invoke(Method.java:521)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at dalvik.system.NativeStart.main(Native Method)
11-16 01:26:07.166: ERROR/AndroidRuntime(779): Caused by: java.lang.NullPointerException
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at intentTest.xyz.com.intentTest.onCreate(intentTest.java:18)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
... 11 more

View 5 Replies View Related

HTC Hero :: Too Many Texts / Crashes When Deleting

Nov 17, 2009

Currently I have over 2700 texts in one thread and as a result the messages app is seriously slow. But when I try to delete them the messages app crashes/freezes and even after killing the task it does not sort itself so I am forced to reboot.How the hell do I delete these!? Is there another way or do I need to wait for the next software update that I care about? The lag is the least of the issues, I believe this is also causing SMS Popup to crash (now uninstalled) but I really love this app.

View 40 Replies View Related

HTC Incredible :: Android OS Crashes And Reboots

Jun 3, 2010

Anyone else having problems with their Incredible crashing and rebooting? Happened to me first a week ago, I thought it was a fluke while sending a txt message it randomly rebooted. Today it happened again while listening to the mp3 player with the screen locked and in my pocket.

View 1 Replies View Related

HTC Desire :: Laptop Crashes With Sync

Jun 17, 2010

If I leave my Desire connected to my laptop (supplied cable, HTC Sync installed and working) with 'sync' enabled all works well for some time, but then after a while my laptop (Sony Vaio Z with Win7) freezes. Unplugging the cable does not help, all I can do is force close the computer with the power switch.

View 5 Replies View Related

Android :: Got EditText Field From XML / App Crashes

Mar 23, 2010

I have an activity in my app, when i call the line
EditText username = (EditText)findViewById(R.id.usernameText); the app crashes, why is this?

View 3 Replies View Related

Android :: App Crashes While Testing Through Instrumentation

Sep 27, 2010

I have separated java code from Android code and have two projects. Android dependent on Java project. Now i want to get the memory trace of the Java project on Android. For that I have created Androd Junit Project implementing Android Instrumentation, and a dummy android project dependent on my actual java project.(as I only want to get memory trace of java project on android).Problem is when I execute Android Junit project, and give a reference of dummy project removing java project dependency, all tests(dummy) run fine.But when I run junit project, with dummy android proj keeping dependency on java project, my application crashes.I get an error message like : "Process crash" not getting any error message in logcat. No clue whats wrong with code.Any help is highly needed.

View 1 Replies View Related

HTC Droid Eris :: Pandora Crashes

Jun 1, 2010

When I pause Pandora for more than a few minutes, the widget absolutely refuses to respond and I have to kill Pandora with a task killer (this is the sole reason I keep the tk around) and then I have to use the icon instead of the widget to restart it.

When it crashes, I have to hit the widget like 7 or 8 times to get it to open up full screen. Then I can hit the 'Like' or 'Dislike' button and they will turn blue for a second but no check appears and the play button does absolutely nothing till I go in and do the kill thing. If I try to just hit the icon before killing it, it opens up full screen does the exact same unresponsive thing.

View 3 Replies View Related

HTC Incredible :: Frequent Crashes - Application

Aug 9, 2010

My Incredible has recently started to crash frequently and it seems to keep getting worse, now at least once or twice per day. It never crashes while I am using it, but I will go to check it later and it is dead. This is getting frustrating because I am missing calls without even knowing the phone is off. I either have to pop the battery or plug into power to force a reboot. Im not sure how to figure out what application might be causing the problem or if maybe it is a hardware issue. Does anyone have any idea what might be causing this, or know what I might do to start troubleshooting?

View 2 Replies View Related

Nexus :: CM 5.8 Crashes When Trying To Record Video

Jul 4, 2010

I have a Rooted Nexus One with Cyanogenmod..

Currently I am running CM 5.0.6-N1 as when I updated to CM 5.0.8-N1 the stable version, I was seeing the phone reset each time I tried to record a video.

Has anyone else seen this issue? Is there a fix? Do I need to do a wipe to get this to work?

View 1 Replies View Related

Android :: Crashes With No Usefull Stacktrace?

Aug 12, 2009

My app has been pretty stable so forth, and suddenly I keep getting these crashes that kill the entire process. What do they mean and how should I deal with them? Since I dont get any usefull stacktrace I really dont know how to debug this. Below is the dump from my error log.

CODE:...................

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved