How do I get device related info programmatically like model number or IMSI , MSISDN while developing codenameone app - codenameone

I am developing a codename app and need to capture device model ,imsi and msisdn information so that i can send data depending on this information.

Try Display.getInstance().getUdid() and Display.getInstance().getMsisdn() you can also use Display.getInstance().getProperty(...) for more properties.

Related

Google smart home action : where to trigger a requestSync?

I created a smart home action and I have to implement the requestSync feature for certification.
But I don't understand from where to call it : from my backend fulfillment ? or from elsewhere ?.
In the documentation, I saw :
You must trigger a SYNC request:
- If the user adds a new device.
- If the user removes an existing device.
- If the user renames an existing device.
- If you implement a new device type, trait, or add a new device feature.
But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something ?
Can someone help me with this feature ?
Thank you !
But I don't understand from where to call it : from my backend fulfillment ? or from elsewhere ?
It definitely should come from backend.
But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something ?
This isn't a case to use the "requestSync". And your backend doesn't need to know about it if your users operate their devices from Google Home app
Here I will explain some example use case for you.
Imagine that you have your own application for controlling your devices. Then you develop the smarthome action project to make your device be able to controlled over voice. When your devices are linked with HomeGraph and you change your device's name, add or remove it from your own application. This is the time that your backend system should make "requestSync".
Even if your system doesn't allow user to make such of those changes on the device unless using Google Home app, google requires your system to be able to send them the "requestSync" for the case that when you "Implement a new device type, trait, or add a new device feature". This is the way that allows you(as developer) to update your users' devices without them(your users) unlinking and relinking their account.
And if you are not clear about "Implement a new device type, trait, or add a new device feature". Just thinking of case that you want to add more traits for your devices and you want to make update on all devices that has been linked before to be able to use a functionality from your new trait. You will need "rquestSync"
Hope this help. Goodluck :)

Xamarin.Forms How to get user name on mobile device

I am trying to receive the user name on a mobile device. I have tried
Plugin.DeviceInfo;
but i get info only about the device. I need to get info about the name and the number that the user has. Any suggestions?
Getting the User name will not work with Plugin.DeviceInfo; Plugin. This plugin is used to access DEVICE INFORMATION, such as OS, Device type...
If you want to get the user name on Xamarin.Forms, you should do it separately on each platform and call the appropriate implementation with the Dependency Service.
HERE is a great blog post which describes fully how to get the user name of a device owner with Xamarin.Forms. I think it is exacltly what you are looking for.

how to make sure whether the telephone has two simcard in my app?

before android 5.0,it didn't support two simcard in original android sdk,how to confirm where the phone has two simcard and get the default setting info about the simcard like "which simcard is used to send SMS default"
You can use SubscriptionManager to get the list of active subscriptions:
https://developer.android.com/reference/android/telephony/SubscriptionManager.html#getActiveSubscriptionInfoList()
To get the default SMS subscription ID you can use this API in SmsManager:
http://developer.android.com/reference/android/telephony/SmsManager.html#getDefaultSmsSubscriptionId()

Google app add attachment option to email

I want to create a google app that will let you add a file from a cloud service as an attachment to an email. From reading the google documentations it seems like you can't do anything while the user is creating an email, but the attachments.me app is able to do it. When composing an email, their app will pop up a button next to the regular attachment app letting you select an attachment from the cloud. I am new to working with google apps and I do not understand how attachments.me is able to do this. If anyone has an idea as to how this is possible please let me know, thanks.
To add features to the GMail UI you'd probably have to implement this as a Chrome extension (and/or Firefox or IE extension to support those browsers). In fact, this is apparently how attachments.me does it.
What the extension does is load when you go to gmail.com, identify a place in the UI where it wants to add its button(s), and inject them using JavaScript. You may then want to use JavaScript again to do something like add a link to the text of the email before it gets sent to the media you want to attach from the cloud, or intercept the "Send" button to tell your server to send the message with the cloud attachment included (assuming the user has authorized your server to send as them -- this can have serious security implications)
Beware, modifying complex web app UIs like GMail's using a Chrome extension can be very difficult; GMail may make changes that break your UI or functionality, and they may do it whenever they want, or only to a subset of users, so you'll have to constantly keep up with these changes to fix bugs. All in all I don't recommend it as a way of adding attachments to emails.

Access mobile phone memory in a device independent way?

I have the requirement to access the following data, where available, on mobile phones with a device independent code
Needed data is
Contacts
Phone logs
Appointments
Tasks
Voice notes and recordings SMS messages
Pictures Videos Application Data
Email and Email attachments
This is needed to write a sort of cleanup application
Thanks!!!
I'm afraid it ain't as easy as that. You have to specify which phone models you are interested in. There is not "Device independent" way of doing this across brands.
Sorry.

Resources