Android :: Smack & Xmpp / Handler - Propagate When Receive Message
Oct 7, 2010
connect / login are executed in the same thread of the caller, then are blocking - The packetlistener callbacks are called from smack receiver thread - The sendpacket enqueues the message to a queue. when I receive a message, I need to propagate it. I can use an handler, but it only gets the runnable object. How can I pass the data to the runnable called by the handler? I can't use a local variabile, because if I receive a lot of messages it will be overridden and I will loose some of them. Is it ok to use a queue to feed the runnable? Are there other techniques?
View 3 Replies
Dec 3, 2009
I am working on a XMPP client on Android, using the Smack library. The roster/messaging/presence stuff is running very well. However, I didn't find a way to store additional profile information (userpicture, the dogs name, ...). The only way I see from googling is using VCards. But it simply did not work. I tried the following:.................
View 3 Replies
View Related
Mar 2, 2009
I am trying to develop a simple chat in Android...... The connect and login with openfire server are ok! The only thing is that , I don't know how do I do to send and receive a message from an other user. I try to create a chat between two users in this way:.................
View 4 Replies
View Related
Jun 9, 2010
I need to download an image from the internet,in a different thread,and then send that image object in the handler message, to the UI thread.And by the way, is this the most efficient way to pass an object to the UI Thread?
View 2 Replies
View Related
Feb 18, 2010
I have an app with a two threads - main and data loader. When data loader finishes it posts a Runnable object to the main thread (as described in the DevGuide), but it never gets delivered and run. Here's the basic code:
class MyApp extends Application{
public void onCreate()
{LoaderThread t = new LoaderThread();
t.start(); }
private class LoaderThread extends Thread {
public void run()
{ SystemClock.sleep(2000);
boolean res = m_handler.post(m_runnable);
if(res)
Log.d(TAG, "Posted Runnable"); } ............
View 2 Replies
View Related
Sep 6, 2010
I was curious about the nature of the handleMessage() and sendMessage() behavior of the Handler class. I want to be able to send message to another thread in such a way that the destination thread can process the message queue when it wants to. It seems, however, that the message is processed by handleMessage() practically as soon as it's sent.
I'm trying to design a game loop thread that does something like this:
CODE:.....
However, I as soon as sendMessage() is called (from the parent/calling thread), the Handler.handleMessage() is processed (in the child/receiving thread), even if the child/receiving thread is blocking in a while loop.
I've seen this problem solved in other games by using a thread-safe list (ConcurrentLinkedQueue). The UI thread just posts events to this queue, and the game loop can remove the events as it seems fit. I just assumed the Handler class was designed for this purpose. It seems it's more intended for asynchronous callbacks to the parent thread.
View 1 Replies
View Related
Sep 4, 2010
I am using an Executor [fixed thread pool] with my own ThreadFactory that adds a Looper:
CODE:...............
I am running a thread that makes network requests but if the network fails I would like a dialog message to be displayed to the user. This process is rather involving since it requires making AND displaying the request in the UI thread. I can wait for the user's response to the dialog by simply adding a Loop to the network thread and wait for a message to be send from the UI thread. This allows me to encapsulate the network requests in a while(tryAgain) thread. All works well except when the Looper.loop() method is called the second time (after a second network error dialog is displayed) and a message is sent by the dialog (in the UI thread) to the network thread's handler:
CODE:.............
In the AlertDialog instance is an OnClickListener:
CODE:...............
I've checked that the thread is still active with handler.getLooper().getThread().isAlive() which always returns true but it still gives me "sending message to a Handler on a dead thread". How is it that the Message/Handler has decided that the thread is dead? Shouldn't it rely on the .isAlive() method? In the end I am trying to avoid replicating the thread management build into the Android OS .
View 1 Replies
View Related
Feb 10, 2009
I have attribute "attr1" defined for my views A, B, C. A and B are actually ViewGroups. Let's say C is contained in B and B in A. Is there an existing mechanism in Android framework that allows me to specify the value of attr1 in A and have it automatically propagated to B and C?
View 2 Replies
View Related
Jun 4, 2009
I'm trying to receive Android's Broadcast message say MEDIA_SCANNER_FINISHED, but not able to do so. Here is my code snippet:
CODE:..............
View 2 Replies
View Related
May 3, 2010
Is it possible to receive SMS message on appWidget?
I saw android sample source(API Demos).
In API Demos, ExampleAppWidgetProvider class extends AppWidgetProvider, not Activity.
So, I guess it is impossible to regist SMS Receiver like this code...
My goal is to receive SMS message on my custom appWidget.
View 1 Replies
View Related
Jan 26, 2010
For starters, the phone is amazing. I just have a few questions: Is it possible to set a ringtone to go off when you receive a text message? MY old VZW phone allowed a ringtone notification. I have yet to find a way to do this; anyone know how?
View 5 Replies
View Related
May 31, 2010
I am new to android. I am creaing an client-server application that receives and sends messages to both client and server. Till now i am able to send messages to server but not able to receive message back from the server. Is there any permissions to be set. Can you help me with the code to receive message from the server.
View 2 Replies
View Related
Nov 11, 2009
I have created a simple server and client both on android phone or emulators. The code...
View 4 Replies
View Related
Dec 8, 2009
For the past two weeks, I am working to create an application ,which is used to communicate with all Messengers in android. I am using Smack api for that, and now I can able to connect to the GTalk.Now trying to connect it to the Yahoo messenger. But it is throwing some exception. I want to know whether we can create Yahoo IM client using smack api or not. If possible please give the list os IM clients supported by Smack api.
View 1 Replies
View Related
Mar 9, 2010
It is easy to find on google which is the broadcast receiver to listen for sms messages. Is there also a similar receiver to listen for gtalk messages or new emails?
View 1 Replies
View Related
Jul 26, 2010
The only problem is when I receive a text message, I get 2 notifications. One from Handcent and one from the stock messaging app on the phone. How do I stop the stock messaging app for good and stop notifying me??
View 2 Replies
View Related
Oct 13, 2010
Ive had my phone for a bout 4 months and this problem has just started and is driving me to distraction. When i receive a text message i get 2 notifications. I get the normal 1 and now a another 1 saying new message(s) which will clear if i click. Also my text message ringtone plays twice also. I use SMS popup as well, but i have been using that for at least 3 months with no problems.
View 1 Replies
View Related
Nov 30, 2009
I'm developing a google maps based application for android 1.6.
My problem is that in my application I have more than one layer that extends from ItemizedOverlay representing information in the map.
The problem is that all the layers implement the onTap method, but now only the last layer (on the top of the stack) detects the tap event, so If the user taps on an item that is in a deeper item the method onTap never fires.
Is there any way to propagate the event to deeper layers?
View 2 Replies
View Related
Jun 4, 2010
I am currently developing android XMPP client to communicate with the Tigase server setup locally.Before starting development on Android I am writing a simple java code on PC to test connectivity with XMPP server.My XMPP domain is my pc name "mwbn43-1" and administrator username and passwords are admin and tigase respectively.Could anyone please tell me the solution for this problem.I checked the XMPPConnection.java file in the Smack API and it looks the same as given in the link solution.
View 3 Replies
View Related
Jan 21, 2009
I am trying to create object of FileTransferManager manager = new FileTransferManager(this.connection);
it is giving error, the same error gives for , OutgoingFileTransfer otransfer = manager.createOutgoingFileTransfer("nimit@pc3/Smack");
I am testing demo app for android, smack library and openfire server (FileTransfer settings are enabled in open fire).
What is solution for this.
But when I put
try{
FileTransferManager manager = new FileTransferManager (this.connection);
}catch(Exception e){}
View 2 Replies
View Related
Jun 17, 2010
when my phone is on vibrate, and i revieve a text, my phone lights up but it dosent vibrate and also, sometimes when i recieve a text it dosent go to the bottom of my text messaging list, it goes in the middle, so when i recieve a message, i have to look through all my messages to see which one i just recieved. i've noticed that the time stamp is incorrect on the messages sometimes, which my be the reason.
View 5 Replies
View Related
Oct 5, 2010
i have my captivate, and i checked the box to vibrate when i receive a text message. however, it only lights up and no vibration occurs.
View 5 Replies
View Related
Jun 4, 2010
Had my Desire for a week now and synced it to Google mail fine. In the last few days though it doesn't make the message notification sound when I receive an email, which it did for the first few days. I haven't changed anything I'm aware of so anyone know whats up?
View 2 Replies
View Related
Jul 13, 2010
Whenever I get a picture message it says download error. I am able to retrieve the picture but I have to open my message app and see who sent me a message. I am unable to access the message via the notification bar. I am using the stock messaging stop.
View 6 Replies
View Related
May 23, 2010
Usually my phone is on silent, and last night, I turned the ringtone volume up. So, I set my notification sound when I receive a message. Whenever I receive a message though, the sound is VERY faint and almost silent. The media volume is all the way up... Is this a phone or Handcent problem?
View 4 Replies
View Related
Oct 23, 2010
I was wandering if anybody could help me with the email notification problem im currently having. Iphones and blackberrys all give you a notification when you receive a new email or a new facebook message. The galaxy s does nothing when you receive a new mail. In settings you can select a ringtone, set it to vibrate when you receive a message. But nothing happens. The only way to find out if there any new messages is by clicking on the email app ( in which i am using hotmail).
View 6 Replies
View Related
Jul 13, 2010
Im have some troubles with my phone and vibrating. When my phone is set in the vibrate mode when i receive a text message my phone does nothing. In the messages app I have it checked off to vibrate when a message is received but still nothing..
View 4 Replies
View Related
Nov 12, 2009
So I've had my Samsung Moment on Sprint for 2 days now and a problem started happening today. Whenever I receive a text message, the phone goes black, locks, the ANDROID screen then displays and the phone goes back to normal but begins looking for service. I have no clue why this is happening but it's really annoying.
View 15 Replies
View Related
Nov 18, 2010
Does anyone know how i can get rid of the droid notification, when i receive a Text message?
View 2 Replies
View Related
Oct 21, 2010
I'm using Google voice exclusively for text messaging. Right now the only way to send/receive texts is to use the google voice app, but I would like to do that through the native message app.
View 7 Replies
View Related