Giter Site home page Giter Site logo

android-jigsaw-puzzle-library's Introduction

An Android library that facilites the creation of Jigsaw puzzles.

All code is GPLv3

How do I create puzzles with the puzzle library

So, you have the puzzle library as an eclipse project, and it's built all properly, with no errors.

  1. Mark the project as a library

    • Right click on the puzzle library.
    • Click properties
    • Go to Android.
    • Scroll Down and check "Is Library"
  2. Create a new application. This will be your future puzzle app.

    • File > Other
    • New Android Application
    • Give it a name, such as "MyPuzzle"
    • Build SDK should be API 16 and minimum SDK should be API 8
    • Click next until you can click finish.
  3. Tie in the Puzzle Library to your new app.

    • Right click on MyPuzzle
    • Click properties
    • Go to Android
    • Click Add...
    • Select the puzzle library.
    • Click Okay
  4. Add new images for your puzzle

    • Create a new folder in res called "drawable-nodpi"
    • Add your puzzle images to this folder.
    • As an example we will use "image1" and "image2"
  5. Edit MainActivity to create the puzzle.

    • Delete the created method onCreateOptionsMenu
    • Your onCreate method should look like:
super.onCreate(savedInstanceState);
		
    int[] mImageIds = { R.drawable.image1, R.drawable.image2, };
		
    Intent intent = new Intent(this, PuzzleSelectActivity.class);
    intent.putExtra("images", mImageIds);
		
    this.startActivity(intent);
  1. And you should add the following to your manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
<activity android:name="org.worldsproject.puzzle.PuzzleSolveActivity" >
</activity>
 
<activity android:name="org.worldsproject.puzzle.PuzzleSelectActivity" >
</activity>

You should be able to run MyPuzzle and it will display the two images as available puzzles.

android-jigsaw-puzzle-library's People

Contributors

atrus6 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.