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 8775623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:51:05+00:00 2026-06-13T18:51:05+00:00

I want to build complex shapes as the intersection of two circles and a

  • 0

I want to build complex shapes as the intersection of two circles and a rectangle. After researching a bit, java.awt.geom.Area class seems perfect for this task.

I was dismayed, however, when I discovered that the awt package doesn’t come with the android SDK. Does anyone know of any alternatives for android that allows me to create complex shapes by defining the union and intersection of simpler shapes?

Note: Using graphics clipping to draw the shape doesn’t work because I don’t just want to draw the shapes, I also want to store the shapes in memory to do collision detection and other interactions.

  • 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-13T18:51:06+00:00Added an answer on June 13, 2026 at 6:51 pm

    Android Alternatives to java.awt.geom.Area

    EDIT: @numan pointed out an excellent option using some classes in the Android SDK that I was unaware of at the time of the original answer:

    https://developer.android.com/reference/android/graphics/Region.html
    https://developer.android.com/reference/android/graphics/Region.Op.html

    Region allows you to define geometric areas, and then you can use Regions op() method with Region.Op enum to calculate intersections and more complex shapes.

    Some other options

    You can use a Canvas to draw custom shapes, particularly using the clip* methods:

    http://developer.android.com/reference/android/graphics/Canvas.html

    Here are some pages about 2d graphics in Android:

    http://developer.android.com/guide/topics/graphics/2d-graphics.html
    http://developer.android.com/guide/topics/graphics/2d-graphics.html#shape-drawable
    http://developer.android.com/guide/topics/graphics/opengl.html

    Some other good options if your graphics remain the same (or roughly the same) are XML-based:

    http://developer.android.com/guide/topics/graphics/2d-graphics.html#drawables-from-xml

    And one solution I find quite neat, is using 9-patch drawables:

    http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

    Collision detection
    It might be overkill for your purposes, but there are a number of game physics libraries:

    http://www.andengine.org http://code.google.com/p/andengineexamples/

    http://bulletphysics.org

    http://www.emini.at/

    http://www.dremsus.com/index.php/2012/01/box2d-game-demo-in-android/

    Android, libgdx and box2d basics

    Or you can roll your own solution:

    http://cooers.blogspot.com/2012/08/simple-collision-detection-in-2d.html

    http://content.gpwiki.org/index.php/Polygon_Collision

    http://www.codeproject.com/Questions/244344/Collision-Detection-in-Android

    Collision detection for rotated bitmaps on Android

    It really depends on the purpose; for games, you’d probably be best to just use a library; but if collision detection is the only feature you need, you’d be better off doing it yourself to save resources.

    Extra Credit: Some indexes of Android libraries

    http://www.appbrain.com/stats/libraries/dev

    http://www.theultimateandroidlibrary.com/

    http://www.openintents.org/en/

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

Sidebar

Related Questions

I feel the two languages are not enough to rapid build complex but high
if I want to build a complex webiste like google news , which gathers
I want to build an application to edit some fields in complex xml documents.
Imagine, I build a complex interface using jQuery/AJAX and want the application with this
i want build a photography app with effects . e.g. old images with brown
I want build a sketch pad app on iPhone, I assume that this type
i want to build a screen for user to get his marks on competitions,
I want to build flash application that can detect the user eyes color and
I want to build a form_tag that will allow me to post a new
I want to build a python program that deletes all the photos from my

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.