Reputation: 1747
I am new to Android and I want to create a Round Telephone dialing screen?
so how to create a screen? Which component need to use LinearLayout
/FrameLayout
/RelativeLayout
, and how to set images for all resolution?
Upvotes: 3
Views: 359
Reputation: 25757
If I were you I would look into creating your own custom UI component. The documentation can be found here Android Custom Components.
You can use the onDraw() method to draw ellipses and pretty much anything else you need. Then potentially add the numbers to form a dial pad. You can output text via onDraw(). Something that might help is the Vintage Thermometer Tutorial this actually draws a round thermometer with numbers on a scale, so it might get you 65% of the way there, while providing a good learning experience. You'll need to strip out the sensor related stuff however that is not too difficult.
As for the dialing, I am not too sure although I would store the numbers pressed somewhere in the activity then have a "dial" button that when pressed does something like
try {
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:+436641234567"));
startActivity(intent);
} catch (Exception e) {
Log.e("Dialer", "Something went wrong dialing...", e);
}
Although with the above the user might have to press dial on your app/widget then again on the actual dial screen where the number will have been populated. Someone here might be able to add some additional information but I haven't seen anything yet to suggest you can dial a number without the user explicitly pressing dial on the phone's dialing app.
You will also need this permission in your manifest:
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
I hope this gets your project underway. If you are struggling I would suggest you start with making a call then sort out the custom UI.
Upvotes: 2