Android :: Cross Activity Listeners
Sep 14, 2010Can I have one Activity listen for a message from another?I have a TabActivity and I need to call a function/send a message to the associated tabs.How do I go about doing that?
View 9 RepliesCan I have one Activity listen for a message from another?I have a TabActivity and I need to call a function/send a message to the associated tabs.How do I go about doing that?
View 9 RepliesI have touched on this question here, where Christopher gave an answer to this, but I dont really get it so I thought its time to make it a real question, not just a "follow up" =)
As it stands, the application Im writing has 4 different screens:
1. Screen 1 - list of nodes (main screen)
2. Screen 2 - options menu, tableLayout with buttons
3. Screen 3 - navigation
4. Screen 4 - text details on version etc
These screens can be navigated to/from using a "header" View that is placed on top. the header then has 4 different buttons:
+--------------------+
| menu with buttons |
+--------------------+
| |
| |
| |
| C O N T E N T |
| |
| |
| |
+--------------------+
The header is just an XML-file (header.xml) with a few buttons. That header.xml is the included in the Layouts using the include-markup. For example, the main.xml has the line:
<include layout="@layout/header"></include>
The header show up alright, but the question is - what is the correct approach to attach OnClickListeners for the buttons in the header?
Christopher pointed out that you could create an Activity class and do the hooks there, like this:
CODE:............
First, I cant make it work since the method setupHeaderButtons isnt accessible from FirstActivity.
Secondly, is this the right way to go at it?
I want to implement an Android Service that periodically downloads data and notifies various listener activities that the data has been updated.
There seems to be various way of communicating with a Service. What's the simplest and best way to do the above?
I have two questions about sensor listeners
1. from which thread are sensor values updated and should this be synchronized? can sensor's listener callback be a good place to call custom's view onDraw method? as this should be done from different thread. I cant find anything about it. In another words my problem is that I want to listen to sensors change and draw something on view surface but I dont know which thread (the main thread of the application?) is updating sensor's state
2. If I register sensor listener with SENSOR_DELAY_FASTEST my application is not responsive at all! Raw application with TextView only is not reacting to go back or home button! How should I deal with this or am I doing something wrong?
I would like to know how to run a listener on an isolated thread. Because I would like to use a LocationListener and make some calculations in the main thread. So the LocationListener would be "slow down", because of those calculations. Is it possible to have it run in a different thread? Or is it by default in a separate thread?
View 2 Replies View RelatedI have following code:
CODE:...........
Code is working but here goes my problem: when I call it from main activity in this way:
CODE:........
Then i can see 10 times result of 'doing sth else!!!' and when loop is over i can see then result from activity. So sensor activity waits for some reason and then when main activity has nothing to do, sensors are doing their job.
of course I have well implemented: onActivityResult(int requestCode, int resultCode, Intent intent)
I want to read sensord data directly, not using listeners, is it possible?
Is there a way to check before sending a broadcast (from a remote service) whether there are registered broadcast listeners? What I'd like to do is to send broadcasts only if there are registered listeners, otherwise make a toast. Does it make any sense?
View 3 Replies View RelatedIs there any decent application for cross platform instant messaging? My wife has an iPhone and I have a Samsung Captivate.I really don't see the point in using SMS to send quick messages back and forth while I'm at work or wherever when we could easily use some IM client.
View 4 Replies View RelatedI am trying to install Android on Beagleboard (TI's OMAP35x chip). They have provided toolchain to build the OS and port it on the chip. Now the next question is developing Android apps. I am interested in knowing about the Java SDK for android. So can I use the standard SDK provided by google, so far I cannot find any SDK provided by TI for Java.Putting it in simple terms, will an application developed on standard Android SDK work on beagleboard.
View 2 Replies View RelatedWe have a desktop/web java application and also getting into Android development.Ideally we would like one app that runs both on desktop and android.From what we can tell, it's not much possible to run normal java apps on android. But wondering if it can do it the other way? That is, run android apps easily on the desktop (without the user install the sdk or android emulator)?In a prefect world we'd like one app for both platforms. Realistically though it seems like we're going to have to have one app with two front ends?
View 4 Replies View RelatedId like to create a small cross-mobile javascript application, which consists of a form and a grid as result. I also want to display some images, with something similar to lightbox. I coded an home maded prototype but id like to add 'touch' effects and support multiple screens easyly.I looked at JqTouch but its very slow on my HTC magic/android. Also found XuiJs but cant find any working example.Anyone found something light, nice, and iPhone+Android compatible ?
View 7 Replies View RelatedI'm looking for a way to collaborate on a "note" with a friend of mine on a Palm Pre. In our case, we want to maintain a collection of quotes together. It'd be nice if we could maintain updates in the same place and have them be in sync. Not necessarily looking for an "app," but a mobile site that would let us accomplish this would work as well. Does anyone have any ideas?
View 4 Replies View Relatedi need an app that has a pc counterpart for video chat. i want top be able to get in touch with my momma via my EVO as soon as i get out of Basic Training. i have been trying every app. fring does not have a working pc app, qik does not seem to plan on this either. skype just released a app who only supports Voip phone calls no video(fail) and none of the conventional im apps are supporting video either: aim, talk, yahoo. did i miss something? is there one?
View 6 Replies View RelatedI am looking for a lightweight cross platform GUI library for different signal-processing applications. An ANSI-C program must be statically linked with it and the size matters. A finished application must have the same look on any platform like iPad, iPhone, Android, Ubuntu, Leopard, Windows, etc.Qt is not appropriate, because it is C++, too big, and doesn't work on iOS devices. I lean toward OpenGL-based GUI library, because OpenGL is supported by every modern target platform and an OpenGL application will have the same look and feel on every device. Preferably, such GUI must support forms definitions using the declarative semantics, e.g. from C strings or from external textual files.
View 2 Replies View RelatedI have a Bluetooth service that I programmed for .Net on a Windows machine and I would like my Android 2.1 phone to connect to it. The server is listening for the same UUID which the Android is using to connect. But the connection is failing.When I try to connect to devices that are not listening for that UUID, I get an exception with the message "Service discovery failed", but when I try to connect to the server that is listening for the right UUID a message box pops up saying:"There was a problem pairing with bluetooth device."And I get an exception with the message "Connection timed out." So it looks like the server and the Android are communicating, but there is some sort of failure during handshaking. I know that the Android requires that the server is paired with the phone and also encrypts the communication channel. Does anyone know which specifications are used to do this? I would love to get my server to respond properly to the connection attempt.
View 3 Replies View RelatedIt is clear that cross compilers will not be allowed by the Apple App Store, so a developer will need to be familiar with Objective-C to create applications for the iPhone.I was wondering, is there a cross compiler that will take Objective-C application code and rebuild it into a similar Java application that can be packaged for Android? That way, a developer could still learn just one language (obj-c) but put out applications on many devices.I understand that the Java port would be less optimal than a natively coded application, but could conceivably save a developer some time.
View 4 Replies View RelatedThe behavior of XMLHttpRequests in Android is very odd when doing cross domain requests. The browser should either fail with an error and not perform the request, or it should follow CORS (http:// www.w3.org/TR/access-control/) and start with an OPTIONS request to the remote domain. The Android browser (2.1 and 2.2) instead performs the request, which is received by the remote server (and this is the dangerous part both for data leaking and remote attacks), but the response is not set in the javascript (status of 0 and responseText null)
View 4 Replies View RelatedMore and more mobile platforms are being launched and sdk's are available to developers. There are various mobile platform are available,Android,iOS,Moblin,Windows mobile 7,RIM,symbian,bada,maemo etc.
And making of corss platform application is headache for developers. I am searching common thing across the platforms which will help to developers who want to port application to all platforms.Like what is the diff screen resolution, input methods, open gl support etc. please share details that you know for the any of platform . or is there possibilities , by writing code in html (widget type of thing) and load it into native application. I know about the android , in which we can add the web view into application. by calling setContentView(view)
Please share the class details where we can add the html view into native application of different type of platforms that you know.
Purpose of this thread is share common details across developers. marking as community wiki.
Cross platform tools & library
Is there a way, apart from using HTML and JavaScript on a web control, to have an (almost) single codebase for an application that should run on iOS and Android?The big issue is of course that they use a different language (Java for Android, Objective-C for iOS) for application development. It would be nice to have some sort of meta-language that will be translated in Java and in Objective-C.What about Flash? Adobe wasn't supposed to release a tool to create flash-based apps in iOS?
View 5 Replies View RelatedI need as simple as possible solution for uploading files (eg. photos) to my website from mobile devices (iPhone, Android, BB, Nokia). Is it possible to do it in same way? Using Java or XHTML?
View 2 Replies View RelatedHow to we setup scratchbox for android to do cross compilation?What type of target do we choose?
View 1 Replies View RelatedI need compiling a lib (ODE) for android - problem is it uses automake and I can't seem to find any decent documentation/how to cross compile a static/dynamic lib for android.
BTW, I'm using ubuntu 12.04 as a dev environment (latest up-to-datest SDK and NDKs are installed) and I have no problem with making the wrapper library - just need to get the static (or dynamic) lib built.
I am a C++ programmer interested in developing applications for Android as well as the iPhone platform. I have explored both these platforms by writing simple applications in Java (Android) and Objective-C (iphone). But the fact is that I am not comfortable with either of these languages, and it bothers me that I have to write 2 very different versions of the same application to support both platforms. (And then what do I do to run it on a Nokia phone?)Is using web technologies (JavaScript/HTML/CSS) a viable solution for writing apps which will run on multiple mobile platforms? I have heard of Appcelerator and PhoneGap, but I am not sure how mature these products are. I'd appreciate any feedback from folks who have used web apps as a solution for developing cross platform mobile apps.
View 5 Replies View RelatedI want to use somthing like: MyLogger.e("MyApp","I have an error.");
In a cross-plattform project, where MyLogger should be static to make it available in the whole project.
So I was trying something like:
CODE:.........
The compiler complains about the static. How do I do this? Is it possible at all? If not, what's the right approach?
I have a site which makes SOAP requests to a separate domain using YUI's cross-domain AJAX transport. This is working wonderfully on my site, but unfortunately since mobile browsers don't support flash, I can't get it to work.Does anyone know of a way to make cross-domain AJAX posts on mobile browsers?
View 2 Replies View RelatedUmi Cross running on android 4.2.1 when is going to update or upgrade to android 4.3 or 4.4?
View 3 Replies View RelatedFor example, I just purchased an HTC One which is running the very latest Snapdragon S600 chip and Adreno 320 and I'm comparing it to the iPhone 5 (A6 and PowerVR SGX543MP3).
Here are a few applications (mostly games) that I've tried on both devices:
* Fruit Ninja - Touch input is delayed by about half a second on the HTC One but instant on iOS.
* Simpons Tapped Out - The voice sometimes stutters and moving buildings just isn't as fluid as iOS.
* Browser (Chrome and Android default) - Scrolling isn't as smooth.
Like I said, I'm honestly not biased one way or the other but this is just what I have noticed. The iPhone 5 has a much lower resolution but I've also had similar results on the iPad Mini (1024x768 resolution).
Does every application written for Android need to optimized for every individual CPU and perhaps these applications weren't optimized yet?
The item menu called up by pressing square immediately disappears after opening...I haven't spent time to get far enough but if that menu doesn't work at certain moments....the story can't progress. Pretty bad glitch. i'm running the 1001 bios, should i try a different one?
View 4 Replies View RelatedI currently have the Gnex and I've spent soooooo much time setting it up to be exactly how I want it to be. I was just wondering if there was any way to save my cache and export it to another device or if cache backups are device specific
View 3 Replies View RelatediPhone MMOG Pocket Legends To Go Cross-Platform News can be found there. Finally is all I can say.For those who don't want to read it it doesn't list a date that it should be ready by but it does indeed say Android will be one of the platforms they are porting to.
View 8 Replies View Related