02.12.2010 14:41, Narendra Bagade пишет:
do u have implementation of wifi lock .

Might go like this:

WifiManager manager = (WifiManager) getSystemService(WIFI_SERVICE);
WifiManager.WifiLock lock = manager.createWifiLock(<your tag string here>);

Locking:

if (!lock.isHeld()) {
    lock.acquire();
}

Unlocking:

if (lock.isHeld()) {
    lock.release();
}

I believe one of these permissions, maybe both, are required:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

WakeLock, which prevents the phone from going into sleep mode, is similar.

I would be a good idea to first check what actually happens - if the download stops because the device goes to sleep, you need a WakeLock.

-- Kostya

On Thu, Dec 2, 2010 at 4:01 PM, Kostya Vasilyev <kmans...@gmail.com <mailto:kmans...@gmail.com>> wrote:

    Specifically for WiFi, hold a WiFi lock:

    
http://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html

    Most likely, though, your device is going to sleep, which causes
    WiFi to be disabled after a certain time. To keep the device
    awake, hold a WakeLock:

    http://developer.android.com/reference/android/os/PowerManager.WakeLock.html

    -- Kostya

    02.12.2010 13:24, Narendra Bagade пишет:

        Hi All,

        I am downloading content on my tablet using ftp with wifi
        connection .
        Once i download one content ,device wifi connection get disable.

        Ianyone can help me how to persist wifi connection evene i am
        download number of content.

-- Regards,
        Narendra
        .
-- You received this message because you are subscribed to the Google
        Groups "Android Developers" group.
        To post to this group, send email to
        android-developers@googlegroups.com
        <mailto:android-developers@googlegroups.com>
        To unsubscribe from this group, send email to
        android-developers+unsubscr...@googlegroups.com
        <mailto:android-developers%2bunsubscr...@googlegroups.com>
        For more options, visit this group at
        http://groups.google.com/group/android-developers?hl=en



-- Kostya Vasilyev -- WiFi Manager + pretty widget --
    http://kmansoft.wordpress.com

-- You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to
    android-developers@googlegroups.com
    <mailto:android-developers@googlegroups.com>
    To unsubscribe from this group, send email to
    android-developers+unsubscr...@googlegroups.com
    <mailto:android-developers%2bunsubscr...@googlegroups.com>
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en




--
Regards,
Narendra
.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to