Android :: Keep FTP Connection - Or Any Connection Object - Alive Between Activities

Oct 27, 2010

I'm coding a very basic FTP client on top of my application and I have 2 activities. The first one is the file explorer and the second one is the image viewer. Once I click on the image filename on the explorer, I want to pass the connection to the other activity to handle extra stuff. Basically, I want to keep the same org.apache.commons.net.ftp.FTPClient object (which handles the connection) alive in-between the 2 activities. I know I can't pass an object inside an intent so I don't know what my best bets are.

Android :: keep FTP connection - or any connection object - alive between activities


Android :: Keep Connection Alive When Screen Goes Off?

Oct 22, 2010

is there any way to keep my connection alive when the screen goes off? my xmpp connection is disconnected due to ACTION_SCREEN_OFF event,

View 3 Replies View Related

Android :: Service Connection Object Is Never Triggered

May 26, 2010

I have followed the Local Service example provided by Google, but my Context::bindService(...) always returns false and there is Service Connection::onServiceConnected is also never called. I understand that Context::bind Service() returns immediately, but my Service Connection object is never triggered. I don't know if these apply My activity is running inside a tabHost and I was wondering if that can affect service binding in any way. The Service itself may have a problem, but I can call start service to the same service with the same Intent and it works as expected. Does anyone have experience with this? Please help me out.

View 2 Replies View Related

Android :: ServerSocket Object To Accept Connection Request In 3G?

Mar 4, 2010

I have been trying to setup a Droid to Droid 3G connection. I can confirm that all works great in wifi mode. The Droid can make connection requests (Http, Telnet, raw sockets) in 3G, but I cannot get the Droid to accept a socket connection in 3G mode. I am using the java.net.ServerSocket class. If anyone knows how to program the Droid to accept socket connection requests over 3G, please respond. Also, if anyone knows why this is not allowed please respond.

View 1 Replies View Related

Same Bluetooth Connection For All Activities?

Oct 5, 2011

I have: A class called BT_Comm BT_Comm creates a bluetooth connection and allows me to send data with it via a method called sendData(int xxx, int yyy).Now, I use this BT_Comm in my main activity -the first one. Say I have 10 Activities, how could I access that same BT_Comm in other Activities?

Eg:
Activity 1 (main)

Code:
BT_Comm bt = new BT_Comm();
pubic void someMethod()
{
bt.sendData(xxx, yyy);
[code]...

View 1 Replies View Related

Android :: Cancel/abort Connection From ThreadSafeClientConnManager Connection Pool

Oct 14, 2009

I'm using ThreadSafeClientConnManager to manage a pool of client connections, because my application has several threads, which are simultaneously connecting to a webserver.

Abstract sample code:

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

Now lets say on of this threads is downloading a large file, but then the user of my application is switching to another activity/screen. Therefor the file is needless and I'd like to abort this download connection.

In ThreadSafeClientConnManager I found this method: public ClientConnectionRequest requestConnection (HttpRoute route, Object state) Returns a new ClientConnectionRequest, from which a ManagedClientConnection can be obtained or the request can be aborted.

So far I've been using:

CODE:.........

Now from what I understand, I've to use:

httpclient.getConnectionManager().requestConnection(HttpRoute route, Object state);

And that's the point where I'm stuck. I assume that for the route I can just use new HttpRoute(new HttpHost("10.0.0.1")) or whatever my server is, but what to put in for Object state?

And second, as soon as I've the ClientConnectionManager I can call getConnection(long timeout, TimeUnit tunit). But then from there, how I do I execute my HttpGet httpRequest = new HttpGet(URL_TO_FILE); as I did before with HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);?

I've been gone through the documentation and tried out quite a few different things, but I wasn't able to obtain a working solution. Therefor any suggestions and/or code examples are more than welcome.

View 1 Replies View Related

Android :: Popup When No Connection Default Connection Failed Dialog

May 12, 2010

Whenever a application needs internet and connection fails, I get a message dialog

Connection failed
This application requires network access. Enable mobile network or Wi-Fi to download data.

and two buttons, Settings, Cancel.

How do I detect there is no internet connection?

How do I popup a same dialog in my application?

View 3 Replies View Related

Android :: Able To Have Voice Connection And Data Connection Simultaneously

Jul 23, 2010

What's the technical term for being able to have voice connection and data connection simultaneously? Like AT&T was promoting heavily for a while.Apparently, the new T-Mobile Vibrant has this capability. A friend got one and was accessing the web while talking to me, double jealous now.I have benn lusting after the Verizon version, Fascinate, and wondering if there is any chance it will as well.

View 2 Replies View Related

Samsung I7500 :: Wifi Connection Lost After Screen Lock And Can't Regain Connection After Unlock

Sep 7, 2009

If my screen locks while I have a wifi connection, then the connection is lost when I unlock the phone.First, is this perhaps deliberate, to save power? Also, either way, when I unlock the screen and go into wifi settings, I see that the phone is trying to make a wifi connection, but it never succeeds, even though it's my home network and I'm in the same room as the router. It just states 'Obtaining address.

View 10 Replies View Related

Samsung Epic 4G :: How Phone Use Wifi Connection As Opposed To 3G Connection?

Sep 15, 2010

Long time reader, first time poster here. How does one know if the Epic is using the wifi connection as opposed to using the 3G connection? When wifi is connected both that and the 3G connection shows at the top. So which one is in control per se? And how can it be verified?

View 3 Replies View Related

Android :: Keep Threads And Views Alive Between Activities

Sep 13, 2010

Trying to understand the Android framework model. I have an application that needs to have several threads running. On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and yet another occasionally polls a server for dispatched orders. Some of these threads update status Views as well.

Since I am new to Android, the application framework model hasn't clicked for me. Where are these threads started? Right now I start the threads in the initial Activity, but if I understand it right, once that Activity goes invisible it is stopped. Furthermore, I have to track GPS and network statistics so that I can have a View which may (or may not) be the active View.

View 1 Replies View Related

Android :: How To Create HTTP Request / How To Create Connection Object?

Jul 17, 2009

How to create an HTTP request object of POST type in android? Which class need to be extend or what method need to implement? How to establish connection to a server? Actually i want to connect to a microsoft exchange server, and then i have to send a request to it using HTTP.

View 8 Replies View Related

Android :: Sharing An Object Between Activities

Nov 24, 2010

I have a Weather app with four Activities. The main/launcher activity is 'invisible' using...

android:theme="@android:style/Theme.Translucent.NoTitleBar"`

Aand is simply used to do a few checks (whether this is a new install, whether a network connection is available etc) before firing off one of the other Activities. The other Activities are UI-oriented - two simply display weather data pulled from a website and the third to provide a location 'picker' so the user can choose which area to show the weather for.

However, all four activities make use of a WeatherHelper object which basically does everything from checking for available SD card storage to maintaining preferences and pulling/formatting website pages.

So, my question(s)...what is the best way to have one instance of WeatherHelper which can be used by multiple activities and where/how are best to create it in my case?

I've been an OO programmer for a lot of years but I'm very new to Android and the design concepts - I've read a lot on the Android Developers site over the past weeks but I've stalled trying to decide on this.

View 2 Replies View Related

Android :: Use One Object In Multiple Activities Within My App?

May 25, 2010

I need to be able to use one object in multiple activities within my app, and it needs to be the SAME object. What is the best way to do this?

I have tried making the object "public static" so it can be accessed by other activities but for some reason this just isn't cutting it. Are there any other ways of doing this?

View 6 Replies View Related

Android :: Pass Unparcelable Object Between Activities

Nov 17, 2010

I have an Object that I need to be able to pass between Activites. It implements Parcelable and I've written all the code related to that. The problem is that one of the properties of the Object is a Drawable - and really needs to be. Unfortunately, Drawable is neither Parcelable or Serializable. I don't understand how to pass it. The reason for having the Drawable is that I need to cache an Image that I've downloaded from the internet at runtime. I don't want to cache the images on the filesystem, since this would potentially end up using up a lot of space over time. I'm putting the image into a Drawable so that I can easily put it into an ImageView.

View 2 Replies View Related

Android :: Service Object Availability Between Activities

Apr 3, 2010

I currently have a service called ConnectionService. It instantiates a Connection object that gives me access to a controller of TCP.

I start the service from a splash screen activity, which sends and intent and starts my "main" activity once a connection has been established. In the "main" activity, I can access my Connection object and communicate with the controller. However, when I start a new activity from the "main" activity and bind to the service, I get a NullPointerException when I try to call methods in the ConnectionService.

View 11 Replies View Related

Android :: Sharing Stream Object Between Activities Of Tab View

Sep 15, 2010

I want to share streams of a socket connection between the activities of a tab view. In particular the tab activity creates the socket and gets the i/o streams,so i want that tabbed activities use these streams to retrieve informations without reconnect to the server each time i switch from a tab to another. I know i can use the application class to have a global state, but i don't know how.

View 4 Replies View Related

Android :: Safely Pass Object References To New Activities?

Dec 8, 2009

I'm working on an application that requires non-serializable objects to be passed between Activities. The following page suggests using a HashMap of WeakReferences to accomplish this:

http://developer.android.com/guide/appendix/faq/framework.html

Is this solution safe? I know Activities are completely destroyed and recreated when the screen orientation changes. Couldn't those weakly referenced objects get GCed in the split second when the screen is rotated, since they wouldn't be referenced elsewhere at that point?

View 3 Replies View Related

Android :: Use USB Connection In App

Jun 8, 2010

I'm wondering if it is possible to open a USB connection in my app. The idea is to plug a specific hardware into the phone USB connection and make it to "talk" with my app.

View 2 Replies View Related

Android :: Lan Connection

Jun 22, 2010

I'm new at programming with Android... I'm stucked at the Network topic...

Basically this is what i'm trying to do:

I wan to send some instructions using the Http protocol to a device which has a static Ip address through a private Lan Network...

So first of all I'ved Tested the Code by connecting to a wesite and everything was Ok, I could confirm the connection was made through the HttpURLConnection ResponseCode()=200 (equals to HTTP_OK) ...So my Code could access the INTERNET. But then i created a Lan Network with the Device mentionned above I couldn't have any Connection to it...neither to other devices (Pc attached to the Network)

My App gets no response...the main Screen switches to a Black untitled Screen...Is there a Permission i have to request through the MANIFEST.XML File for Lan Networks as there is a one for INTERNET?...

View 2 Replies View Related

Android :: Wi Fi Connection

Jun 22, 2009

How to connect to a secured wireless network programmatically.. im able to detect and list the available networks but how do i connect to it giving a password..

View 3 Replies View Related

Android :: Sql Connection

Aug 22, 2009

I wrote java code that connects remote sql server. But code does not work in android.

Code is as follows:

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

And log is follows:

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

View 3 Replies View Related

Android :: Udp - Tcp Connection

Jul 16, 2010

I wanted to ask if there is a possibility to create udp connection and then change to tcp connection while the emulator is client and the server's code is java. all I found at the web is or tcp connection or udp but never a mixed between them.

View 8 Replies View Related

Android :: Lap Top Connection

Aug 7, 2009

I was wondering if it was possible to connect the lap top with the T.M G1 phone to get internet connection.

View 2 Replies View Related

Android :: SQL Server Connection

Aug 16, 2009

I am trying to connect remote ms sql server 2005 and tried something but I could'nt. Does any of you know to connect sql server? I searched and I realize that Driver must be loaded.

View 3 Replies View Related

Android :: Communicating With The PC Via USB Connection

Apr 12, 2010

I'm fairly new to android programming and need some information for a 4th year forensics course project. Basically I am trying to create a suite of tools for live analysis of an android phone. I know how to get the information I need on the phone, but I was wondering if there was a way to communicate that information back to the PC? I want to be able to run a program from a PC, which, when the phone is docked, will allow the user to access information about the phone (ie currently running services/processes, bluetooth/wifi connections, etc). I have a bunch of methods that will run on the phone and get all the information, but I want to be able to call those methods from the PC, execute on the phone, then have the information sent back to the PC to display to the user instead of just displaying it on the phone. This is to leave as small a footprint on the phone as possible.

View 1 Replies View Related

Android :: Possible To See What's Using Data Connection?

Apr 14, 2010

I've got my Desire to allow background sync and auto sync etc, but I was wondering if there was an app that anyone knew of that would tell me which application has been using the data connection and for how long etc? A bit like the battery stats that says which application has been using the battery but for data connection if you see what I mean.
I've seen a few apps that seem to give an overall usage figure so you can track how much data you're downloading in a month but nothing per app.I originally posted this in the HTC Desire section but I think this section is more appropriate, not sure how to move a post so have done it again. Sorry if that's a problem.

View 1 Replies View Related

Android :: Need App For Macbook Connection

Dec 30, 2009

This is my first post as a newly registered user of the AndroidForums. I am ridiculously new at all this as I've never had a smart phone before. Anyways, I'm not sure how to connect my Motorola Droid to my MacBook. The only thing I've tried is just connecting them via USB and nothing appeared on my screen. I imagine I might need some apps or something to get the connection realized or whatever by my Mac.

View 1 Replies View Related

Android :: Can I Somehow Use Gmote Across Connection?

Aug 30, 2010

Can it be done? If I have my PC wifi tethered to my phone, can I somehow use Gmote across that connection?

View 3 Replies View Related

Android :: Bluetooth Connection - PC

Nov 2, 2009

Is there any way to comunicate an android phone with a computer trough bluetooth? Ive made a server/client applicattion in Java using bluetooth, but i need to do the client in Android and i dont know how to start, I dont know even if is possible. I only need to send a text message.

View 2 Replies View Related







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