Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Info API's #9

Closed
Redth opened this issue Feb 24, 2018 · 10 comments
Closed

Device Info API's #9

Redth opened this issue Feb 24, 2018 · 10 comments
Assignees
Milestone

Comments

@Redth
Copy link
Member

Redth commented Feb 24, 2018

Basic information about a Device and its Operating system.

DeviceInfo

Properties

  • string Model (readonly)
  • string Manufacturer (readonly)
  • string DeviceName (readonly)
  • string Version (readonly)
  • Version VersionNumber (readonly)
  • string AppVersion (readonly)
  • string AppBuild (readonly)
  • string Platform (readonly)

    These values returned will match those which Xamarin.Forms uses.

  • string Idiom (readonly)
  • bool IsDevice (readonly)

DeviceInfo.Idioms

Consts

  • string Car = nameof (Car)
  • string Desktop = nameof (Desktop)
  • string Phone = nameof (Phone)
  • string Tablet = nameof (Tablet)
  • string Television = nameof (Television)
  • string Watch = nameof (Watch)

DeviceInfo.Platforms

Consts

  • string Android = nameof (Android)
  • string iOS = nameof (iOS)
  • string UWP = “Windows” // must match Forms
@Redth Redth added this to the Preview-1 milestone Feb 24, 2018
@Redth
Copy link
Member Author

Redth commented Feb 24, 2018

I think battery information should exist somewhere in here too, perhaps something like:

Battery

Methods

  • static double Percent (readonly)

@mattleibow
Copy link
Contributor

Maybe battery needs to be a separate API. It may be useful to have more properties:

  • Percent
  • IsCharging or ChargingState

@mattleibow
Copy link
Contributor

The DeviceInfo API probably should either be static or have a private constructor.

@Redth
Copy link
Member Author

Redth commented Feb 24, 2018

Yes battery goes in its own class.

Can we get charging state on each platform?

@mattleibow
Copy link
Contributor

I think so. Moved to #20

@mattleibow mattleibow self-assigned this Mar 1, 2018
@jamesmontemagno
Copy link
Collaborator

Additional APIs:

  • IsEmulator
  • DeviceWidth
  • DeviceHeight
  • DeviceOrientation

@jamesmontemagno
Copy link
Collaborator

We should evaluate what Id means as well. Is it the serial number or a specific Id. I struggled with this a lot.

@Redth
Copy link
Member Author

Redth commented Mar 2, 2018

I think SerialNumber should give that info and Id should be a unique id compliant with the platform.

@mattleibow mattleibow mentioned this issue Mar 5, 2018
4 tasks
@mattleibow
Copy link
Contributor

Removing the DeviceInfo.Id property as this requires more research.
See #61.

@mattleibow
Copy link
Contributor

Merged in #54

Redth pushed a commit that referenced this issue Mar 13, 2018
* Work to move thread switching into the library
 - no need to run on main thread for consumers
 - samples now have improved view models for page events
 - pages now derive from BasePage which understands view models
 - removed caching for device info

* Improve the battery test for better failure messages

* Fixing the device tests
@mattleibow mattleibow added this to Done in v0.5.0-preview Mar 28, 2018
@mattleibow mattleibow moved this from Done to Closed in v0.5.0-preview Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.5.0-preview
  
Closed
Development

No branches or pull requests

3 participants