Results 1 to 8 of 8
  1. #1
    tornado is offline Member
    Join Date
    Nov 2008
    Posts
    14
    Rep Power
    0

    Default Can we Obtain Java Source Code?

    Hi,

    You know how when learning HTML we can view source code of web pages to aid our learning, can I obtain the java files from a java internet application? How could I do this?

    Lets say a flash based java client, how could i get the java files to see how they create it?

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    Java has a-lot of open source projects that will show you their code. Flash-based java client? That sounds a bit like Flex.

    There's also a TON of java examples out there for you to look at also. Curious what application are you trying to get the code for?

  3. #3
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    Your question is slightly unclear (what is a "flash based java client"?). If you mean:
    - "can I get the source code to server-side application", the answer is obviously "not unless they give it to you";
    - for "can I get the source code to a Java applet", the answer is that you can get an approximation of the source code.
    Java programs are compiled to bytecode, which preserves more information about the original source than if it were native machine code. You can use a Java Decompiler to turn the compiled bytecode back into an approximation of the original source code.

    However, it's not clear that this will be terribly useful for your purpose. Because various things such as local variable names and comments get lost in the compilation process, the decompiled code will be difficult to read, and so probably won't represent a "clear, recommendable way" of doing the thing in question.

    If you want to "learn how to do things in Java", I would strongly recommend just searching for open source code that does the thing you want to do. For most things, there's something somewhere. Look for projects on Freshmeat, Sourceforge etc, or try Google Code Search.

  4. #4
    tornado is offline Member
    Join Date
    Nov 2008
    Posts
    14
    Rep Power
    0

    Default

    OK sorry well in particular I was looking at this poker software, which claims it's a flash based java client? I was interested on how poker software runs and is coded etc, and was wondering if I could get the files, but I guess that's impossible?

    It's just obviously with web pages you can easily view the HTML CSS PHP & JS files, which can't really be hidden so was wondering if java had the same sort of principles.

    I'll look into java decompiler, although i'll probably need an swf decompiler to decompile the flash first.

    In general i've just started to learn java, and i'm interested into what it's used for in relation to the internet and how it works.

    Because obivously the best way to learn is via examples, i'll have a look at the open-source projects aswell.

  5. #5
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    If the thing you want to do is learn to write a poker game, I'd really forget about one particular example you've seen without source code, and just search for open-source poker and card games written in Java -- there must be at least a squillion.

    Note that one thing that in the case of commercial on-line poker games where money is involved, they may (actually, SHOULD by law in some countries) use techniques for random number generation that a casual poker game may not use. So as you get more advanced, that may be something you want to look into. But other than that, various open source projects should give you what you need to get going.

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Yeah, let's start with getting some decent randomizer stuff - drop all the flashy stuff for now. There is plenty of support in Java for driving Flash and there will be no shortage of that if and when you are ready but for now, if you are going to do any gaming like you talk about start with Math.random and fast as you can gravitate towards
    Java Code:
    /*
     * <p>A cryptographically strong random number
     * minimally complies with the statistical random number generator tests
     * specified in <a href="http://csrc.nist.gov/cryptval/140-2.htm">
     * <i>FIPS 140-2, Security Requirements for Cryptographic Modules</i></a>,
     * section 4.9.1.
     * Additionally, SecureRandom must produce non-deterministic 
     * output and therefore it is required that the seed material be unpredictable
     * and that output of SecureRandom be cryptographically strong sequences as
     * described in <a href="http://www.ietf.org/rfc/rfc1750.txt">
     * <i>RFC 1750: Randomness Recommendations for Security</i></a>.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    Of course, even SecureRandom "only" has a period of 2^160, and there are approximately 2^224 ways to shuffle a single deck of cards...!

  8. #8
    tornado is offline Member
    Join Date
    Nov 2008
    Posts
    14
    Rep Power
    0

    Default

    lol and here was me thinking I could use this to my advantage on poker sites, obviously not!

    I've been testing out the random generators, and googling around thanks for the push in the right direction neil and nicholas it's appreciated!

Similar Threads

  1. Replies: 1
    Last Post: 11-28-2008, 07:27 PM
  2. Replies: 0
    Last Post: 11-25-2008, 10:24 AM
  3. How to obtain ASCII code of a character
    By karma in forum New To Java
    Replies: 4
    Last Post: 07-20-2008, 03:57 AM
  4. A simple Java source code viewer
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:34 PM
  5. open source java code
    By reena in forum Advanced Java
    Replies: 1
    Last Post: 04-19-2008, 07:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •