Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9004571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:55:34+00:00 2026-06-16T00:55:34+00:00

I am pretty sure this question has been asked before, but I could not

  • 0

I am pretty sure this question has been asked before, but I could not find it anywhere, so please don’t bite.

I am writing an android app, that needs to communicate with nearby devices and I want to used WifiDirect API if two devices that have it happen to be nearby.

But if that’s not the case application can still work and it will use other less effective ways to communicate between participating devices (like Wifi Access Point sharing).

I also want this app to be possible to run on older devices like android 2.2 which does not have WifiDirect API at all (>=4.0 I think).

So is there anyway to make my app optionally use new API, but not necessarily in case of older phones?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:55:36+00:00Added an answer on June 16, 2026 at 12:55 am

    so please don’t bite

    Can we at least gnaw a little? Just a nibble?

    🙂

    So is there anyway to make my app optionally use new API, but not necessarily in case of older phones?

    You can wrap your references to new classes/methods in Java version guard blocks:

    if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      // do stuff with WifiP2pManager
    }
    // optional else block for workaround for older devices
    

    There may be other particulars for WiFiDirect, which I haven’t used yet, but that’s the basic step.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty sure that this question has been asked before, but my case
i'm pretty sure that this question has allready been asked (but i didn't find
I'm sorry if this question has been asked before, but I'm not even sure
Pretty sure this has been asked already, but I don't know what to search
sorry if this question has been asked before, I searched but wasn't sure on
im pretty sure this question anywhere already has been asked anywhere - didnt found
I'm not sure if this question makes sense, but it has been pretty hard
I suspect this has been asked before, but can't seem to find a question
I am sure this question has been asked but I can't find anything that
I'm pretty sure it hasn't, but apologies if this question has already been asked.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.