Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

Showing Visualizations in Particular Positions in Android Studio

$
0
0

I am developing an Application in Android. For the visualization part, I am using Processing. Now I would like to show a number of visualization on one Android Activity.

The standard code for one visualization is the following:

public class MainActivity extends AppCompatActivity {
  private PApplet sketch;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(CompatUtils.getUniqueViewId());
    setContentView(frame, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                                                     ViewGroup.LayoutParams.MATCH_PARENT));

    sketch = new Sketch();
    PFragment fragment = new PFragment(sketch);
    fragment.setView(frame, this);
  }

The code found on the "Processing for Android" website works for a single visualization. Now I would like to extend this to a number of visualizations each given a specific (x,y) position on the Activity Layout. Which methods allow me to do that?

Can you point me in the right direction?

Kind regards,

Niels


Viewing all articles
Browse latest Browse all 941

Trending Articles