Android :: Android IPhone SDK Delegate Callbacks?
Aug 1, 2010
I just switched over from iPhone to Android and am looking for something similar to where in the iPhone SDK, when a class finishes a certain task, it calls delegate methods in objects set as it's delegates. I don't need too many details. I went through the docs and didn't find anything (the closest I got was "broadcast intents" which seem more like iOS notifications). Even if someone can point me to the correct documentation, it would be great.
View 37 Replies
Sep 23, 2010
I just switched over from iPhone to Android and am looking for something similar to where in the iPhone SDK, when a class finishes a certain task, it calls delegate methods in objects set as it's delegates.I don't need too many details. I went through the docs and didn't find anything (the closest I got was "broadcast intents" which seem more like iOS notifications).Even if someone can point me to the correct documentation, it would be great.
View 1 Replies
View Related
Dec 25, 2009
Here's the situation I have.
The GMail account I have and registered to my cell phone when I got it is an account I've had since the first few weeks GMail was in beta by invitation only over 5 years ago. Needless to say, I have hundreds of contacts in that account.
When I activated my Droid, they ALL came over. What a mess. The Verizon guy emptied my contacts on the phone and uploaded my phone book from my BlackBerry.
I want to sync my Droid's address book to a second gmail account I made just for this purpose, but I can't get them to sync over. How do I delegate my phone's contacts sync with that second Gmail account?
I added it under Gmail and logged in. Under Contacts > Accounts, that account sync is ON for contacts and auto-sync & Background data is checked.
View 1 Replies
View Related
Feb 25, 2010
Here I update my world to include the canvas size. world.getViewPort().updateViewPortSize(width,height); Is there a better way to do this? Is there a way that I can automatically update my world object without having to manually call it in the setSurfaceSize method but instead call it from My world class? My guess is that I can use some sort of callback, but I don't understand them!
/* Callback invoked when the surface dimensions change. */
public void setSurfaceSize(int width, int height) {
// synchronized to make sure these all change atomically
synchronized (mSurfaceHolder) {
mCanvasWidth = width;
mCanvasHeight = height;
world.getViewPort().updateViewPortSize(width,height); }
View 1 Replies
View Related
Oct 13, 2010
If it must implement with AIDL? And please kindly provide an example. There are several solutions, Does anyone know which is better?
View 1 Replies
View Related
Sep 18, 2010
I have an android application. Based on the current geo location of user, I want to fetch some remote data in background and store it. My implementation is: At specific interval a alarm fires up my service. Service uses an anonymous class to query current location and registers a locationListener callback. On call of onLocationChanged() I initiate the remote data fetch from server.
However once my service is done registering the location listener using anonymos class, it returns as expected; as it doesn't wait for callback to happen before finishing. Since callback takes some time and makes a call when service has already returned, it throws an error saying: java.lang.RuntimeException: Handler{43e82510} sending message to a Handler on a dead thread
Which is quite understandable. One quick workaround for me now is that I can use getLastKnownLocation from locationManager as that doesn't respond back by callback; but what if I do want the latest location right now, in a service and not activity? How can I wait for callback to happen and stop my service from returning.
Also, at what point does lastKnownlocation gets updated? Everytime GPS registers a new location; does it update it? What I want to know is that if it's not latest can it still be closed to latest? As I didn't see an option in android emulator to configure the time period between subsequent updates.
View 1 Replies
View Related
Sep 17, 2010
I am doing authentication with a third-party site that's supposed to redirect back to my app with auth token (OAUTH).
I have the callback working properly if I open the 3rd party site in a separate browser process via this.startActivity(new Intent(Intent.ACTION_VIEW, uri));
But, if I embed a WebView component in my layout, and open the url in that, the callback does not work. Webview says "You do not have permission to open myapp://callback?token=...." and quickly refreshes to "Web page not available...temporarily down..."
View 1 Replies
View Related
Jul 7, 2010
I'm working on a service for my application whose purpose is to allow easy access to various web services we are running. The service is used to maintain a login state across any applications that want to use it so the user only has to log in once when the service is first started.
What is the best way to go about making the service run asynchronously and call back to the application when it is finished. Currently I am using static classes that extend Thread such as
CODE:.....
And to make it easy to call
CODE:....................
But these functions can only be called by my own application. I want anyone to be able to make a one or two line function call and be able to handle the response easily, preferably in a simple callback method.
I figure it has to be done using Intents to start the Threads, but if I do that I can't pass a callback.
View 2 Replies
View Related
Aug 17, 2010
We are supposed to make UI actions only from the main UI thread. But it is not clear to me if callbacks like LocationUpdateListener (and other callbacks from sensors) are already in the UI thread or they require special care to access the UI components.
View 2 Replies
View Related
Oct 12, 2010
There are a lot of Android SDK APIs where callback handlers are registered. For a concrete example, with MediaPlayer you can set an onCompletionListener callback. Will these callbacks be called from the main (UI) thread? If the answer is "it depends", then I'm looking for some general rules for what callbacks will be called from the main thread versus another thread. The SDK documentation doesn't seem to spell it out. (Maybe I missed it) It seems important to know, because if I'm guaranteed main thread callbacks, then I can skip some thread synchronization on data shared between different places in code. If I'm forced to be pessimistic out of ignorance, then I have to write extra synch block code and worry about deadlocks, data integrity, and reduced performance.
View 4 Replies
View Related
Jul 15, 2010
Is there a way to obtain the time zone from the callbacks received
void onLocationChanged(Location location)
using the time information that can be obtained from the location parameter
long Time = location.getTime();
Or if there is another way please provide info!
View 2 Replies
View Related
Aug 3, 2010
I want to get the size of a view that is in my activity but I am not able to get that information in any of the activity lifecycle callbacks (onCreate, onStart, onResume). I'm assuming this is because the views have not been drawn yet. At what point are views drawn and is there a callback I can put my code so I can get the size of the view?
View 2 Replies
View Related
Jun 1, 2010
I was wondering if it's possible to call specific methods defined within the AsynTask class from another class and/or service ?
In my specific case I have a Service playing some sounds, but the sound is selected from a List with available sounds...
When a sounds is selected it is downloaded from my home server, this takes some time (not much, let's say around the 3-4 seconds, the sounds/effects aren't big in size)...
So my problem at the moment is that I have a service to play those sounds, and when I select one I wanted to show a progressdialog... The way (if I understood correctly) is to use an AsyncTask, but the only thing the AsyncTask will do is telling my Service to play a specific sound from my server... So there is no "callback" from the service to the Asynctask...
How can I call a running AsyncTask, which sits in another class, and tell him all work is done and thus he can stop showing the ProgressDialog ? Or am I over-engineering it and there are other ways ?
View 2 Replies
View Related
Nov 16, 2010
I'm new to Java, I'm porting over our Windows Phone 7 library to run on Android. Due to syntax similarities this has been very simple so far. Our library is basically an abstracted http message queue that provides data persistence and integrity on mobile platforms. It only provides asynchronous methods which is a design choice. On WP7 I make use of delegates to call the user supplied callback when an async message has been processed and the servers response received.
To achieve the same thing on Android I've found two ways so far - A simple Java listener interface that contains OnSuccess and OnFailure methods that the user must implement, or using the Android handler class which provides a message queue between threads(http://developer.android.com/reference/android/os/Handler.html).
I've gone with the Handler at this stage as if I'm honest it is the most similar to a C# delegate. It also seems like less work for a user of our library to implement.
Example of some user code to make use of our library:
CODE:.............
Using this the user can create as many different handlers as they'd like, called whatever they'd like, and pass them in as method parameters. Very similar to a delegate...
The reason I'm wondering if I should move to a listener interface is because the more exposure I gain to Java the more it seems that's just how it's done and it's how third parties using our library would expect it to be done.
It's essentially the same process, except each time you wanted to do something different with the server response i.e. You might be fetching different types of data from different endpoints, you're going to have to create a custom class that implements our interface each time, as well as implementing any methods our interface has. Or of course you could have a single monolithic class that all server responses were funneled in to but have fun trying to figure out what to do with each individual response...
View 2 Replies
View Related
Apr 2, 2010
I am developing on a Mac with Eclipse and have the skeleton for an app that implements the standard framework callbacks (onCreate, onDestroy, onPause, etc.). When I set breakpoints in the callbacks the debugger stops and displays a tab that says
"ActivityThread.performLaunchActivity(ActivityThread $ActivityRecord,Intent)line:2477" and in the tab page body there is some red text that says "Source not found" and a button that says
"Edit Source Lookup Path...". I have tried adding several paths via "Edit Source Lookup Path..." but can't see to find the one Eclipse is looking for.
View 1 Replies
View Related
Nov 11, 2010
I'm just getting started with mobile development, and after considerable searching I'm still confused about sending a message from my iPhone to another or an Android.For instance, in building a simple Tic-Tac-Toe game, if I want to notify the other phone of a move, what is the best way to do so? Wifi, bluetooth, 3G? And how? Many methods seem to point to communicating through a web server, but I'd rather send them directly from phone to phone if possible.
View 4 Replies
View Related
Jun 30, 2010
ok, its the Apple Fanbois turn to try and outdo the funniest video on the web..check out their lame attempt to copy it. Code...
View 12 Replies
View Related
Oct 30, 2013
When a group message is sent between my co-workers, who are all iphone users, and myself (Note 3), one person in the exchange does not receive the text. This is not the common iMessage issue that was plaguing me when I made the switch from Apple to Android. This is specifically affecting one iphone user. When I send her a text individually it is not a problem. The other iPhone users don't have a problem receiving or sending to me.
View 3 Replies
View Related
Jun 7, 2010
I just watched the marketing video for the iPhone 4 and it is pretty sick! I came back to Verizon last summer (because I was disappointed with AT&Ts service) and I had, in order, an HTC Droid Eris, a MotoDroid, and now I have the DInc. So far, the DInc is the only device that I personally feel holds a candle to the 3GS. So now that 4 is out...I am torn!Somebody convince me that I should stick with Android.I really like Android but something about iPhone just set the bar for me.
View 49 Replies
View Related
Sep 9, 2010
The newest Verizon Android, the Samsung Fascinate, seems to be advancing a bad trend. On top of the irremovable, unstoppable bloatware we have all come to expect from AT&T (and now Verizon), the Fascinate will feature Bing widgets, Bing maps, and Bing search. The Market app on the Fascinate�s version of the Android will also block all access to any Google apps and widgets (search, maps, etc).So much for the free spirit open source nature of the Android. If this trend continues across all carriers, it will kill the Android.
View 49 Replies
View Related
Sep 21, 2010
Just would like to hear your idea about that...I recently have seen the Samsung Galaxy S and , well, was really impressed about that! Then I have seen the new HTC Desire and heard good rumors about that. So, I was wondering, which one would you take as an alternative to the i Phone 4G? I have seen some price alternatives for Samsung Contract Mobile Phones galaxy s: compare models and prices contract mobile phones galaxy s. - Choppy Doo and HTC Contract Mobile Phones htc desire: compare models and prices contract mobile phones htc desire. - Choppy Doo What would you take if you were in my shoes?
View 3 Replies
View Related
Mar 17, 2010
Apologies if this has already been discussed and not wanting to start any sort of flame wars.Has anyone else moved to Android from iPhone? If so what where the main reasons.I am patiently waiting for the HTC Desire to land in the UK to upgrade, my main reasons for doing so are:Dislike of Apple's recent activities, the seeming arrogance they have in thinking they are the only company that should be able to provide a touch screen smart phone.Getting away from the walled garden of iTunes and iPhone. I want to be able to use my phone however I like and not how Jobs and co tell me.Being able to change base functionality how I like. Prime example being podcasts.I regularly download 3-4 a week and hate having to either connect to iTunes or manually check every time for all my podcasts.There isn't an app for that, Getting the latest hardware that I want and being able to chose the features that are important to me. Do I want a keyboard, a better camera, a removable battery.
View 16 Replies
View Related
Jul 14, 2010
Another ex iphone user coming over from the darkside
View 15 Replies
View Related
Jul 23, 2010
I sometimes get sms text messages from people using an iPhone which occasionally also use all sorts of specific emoticons which in android are displayed as little square boxes.Does anybody know of an app or emoticon-pack of some sort, with which these icons can also be displayed on my android phone?
View 5 Replies
View Related
Nov 5, 2010
I thought this was hysterical and so true haha
How Android, BlackBerry and iPhone users see one another | Android Central
View 17 Replies
View Related
Sep 24, 2009
Has anyone tried this cross compiler to get their Android app to run on an iPhone?
http://xmlvm.org/android/
View 3 Replies
View Related
Sep 23, 2010
I have done some searching on this subject. Cant really find an updated post or info (most seem to be from 2009). I have tried Jorte and pure calendar. I dare say that I really really like the iphone calendar app (maybe the only one from iphone I like).
View 12 Replies
View Related
Jul 22, 2010
I've owned an original iPhone since launch and am now ready to upgrade.
Im considering iPhone 4 or the Captivate. If the iPhone didn't have antenna issues, I would most likely have already made my decision. However this isn't the case so I'm looking at other options (leaving AT&T isn't one of them).
So I just have a few questions regarding Android.
Can you backup apps, settings, contacts (everything) to your Mac or PC like an iPhone can? (I know about doubletwist, but thats just music and movies, right?)
When Android updates come out, can every phone take advantage of it? For example, if I were to buy the captivate, will I for sure be able to upgrade to Android 3.0?
Lastly, what are big features (besides visual customization) that an Android phone has to offer over iPhone?
I'm very on the fence about which phone to purchase. There is the potential antenna issue regarding the iPhone 4, however I've also been hearing the Captivate is having its fair share of problems. Any suggestions?
View 1 Replies
View Related
Aug 26, 2010
Im choosing a new mobile phone from theese 3 smartphones (galaxy s vs desire vs iphone 4). I need good music player, good gps, fast and good functionality, internet browsing. I like samsung, but i heard that galaxy S lags, and gps lags. Is samsungs lags fixible ?
And what is the best choice from these smartphones ?
View 31 Replies
View Related
May 27, 2010
What would be the best way to write an app for the iPhone OS and the Android OS that allows access to a web blog (posted on blogspot.com)? Are there ways to manipulate the incoming data from the website to fit the UI of the phones, or will I have to re-do a lot of the blogs?Any help would be nice.
View 2 Replies
View Related