Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Yabanize

2348 posts

Uber Geek


#143926 1-May-2014 18:52
Send private message

Hi, Im trying to make a basic app

I was reading this about how to make a settings page for an app http://developer.android.com/guide/topics/ui/settings.html and according to this 

 

     

  • If your app supports versions of Android older than 3.0 (API level 10 and lower), you must build the activity as an extension of the PreferenceActivity class.
  • On Android 3.0 and later, you should instead use a traditional Activity that hosts a PreferenceFragmentthat displays your app settings. However, you can also use PreferenceActivity to create a two-pane layout for large screens when you have multiple groups of settings.
So this means if I want my app to support 2.2 and 2.3 (as alot of devices still have) I need to use the PreferenceActivity class, And if I do will my app still be compatible with 4.0, 4.1, 4.2, 4.3 and 4.4?

Ive tried doing this and have had a bit of trouble :/

Create new topic
networkn
Networkn
30209 posts

Uber Geek

ID Verified
Trusted
Lifetime subscriber

  #1035080 1-May-2014 19:28
Send private message

At least 50% of developers have hair I'd wager :) 


 
 
 

You will find anything you want at MightyApe (affiliate link).
TwoSeven
1512 posts

Uber Geek

Subscriber

  #1035127 1-May-2014 20:41
Send private message

Its basically saying that they prefer you to do it the new one on Android three and later, but it is not mandatory.

While I am not an Android developer,   use a Façade pattern to give yourself a common interface, underneath the façade, use a Factory method to return the correct  object.  You'll need to create an object that implements the PreferenceActivity (which as far as I make out is the Deprecated version) and an object that implements the PreferenceFragment (which I think is the new way).  - basically, this is a form of run time binding depending on platform version.


    So in your factory method you detect the version and implement the correct one.  However, looking at PreferenceFragment I can't see why that is not backward compatible, if it is, then you can simplify the above.




Software Engineer
   (the practice of real science, engineering and management)


Create new topic





News and reviews »

Samsung Announces Galaxy AI
Posted 28-Nov-2023 14:48


Epson Launches EH-LS650 Ultra Short Throw Smart Streaming Laser Projector
Posted 28-Nov-2023 14:38


Fitbit Charge 6 Review 
Posted 27-Nov-2023 16:21


Cisco Launches New Research Highlighting Gap in Preparedness for AI
Posted 23-Nov-2023 15:50


Seagate Takes Block Storage System to New Heights Reaching 2.5 PB
Posted 23-Nov-2023 15:45


Seagate Nytro 4350 NVMe SSD Delivers Consistent Application Performance and High QoS to Data Centers
Posted 23-Nov-2023 15:38


Amazon Fire TV Stick 4k Max (2nd Generation) Review
Posted 14-Nov-2023 16:17


Over half of New Zealand adults surveyed concerned about AI shopping scams
Posted 3-Nov-2023 10:42


Super Mario Bros. Wonder Launches on Nintendo Switch
Posted 24-Oct-2023 10:56


Google Releases Nest WiFi Pro in New Zealand
Posted 24-Oct-2023 10:18


Amazon Introduces All-New Echo Pop in New Zealand
Posted 23-Oct-2023 19:49


HyperX Unveils Their First Webcam and Audio Mixer Plus
Posted 20-Oct-2023 11:47


Seagate Introduces Exos 24TB Hard Drives for Hyperscalers and Enterprise Data Centres
Posted 20-Oct-2023 11:43


Dyson Zone Noise-Cancelling Headphones Comes to New Zealand
Posted 20-Oct-2023 11:33


The OPPO Find N3 Launches Globally Available in New Zealand Mid-November
Posted 20-Oct-2023 11:06









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.