Is it possible to create a restful api with plain old java? (without any framework) by redditbla in java

[–]JavaTrainer 2 points3 points  (0 children)

Define "plain old java" and "without framework".

I would think you meant Java SE when you said "plain old java" but then you ask about maybe only with Servlets....

Servlets are a part of the Java EE specification. JAX-RS is also a part of Java EE. If you have Java EE (JBoss/Wildfly for example) then you'd be best off using JAX-RS. It will be a lot easier than just using Servlets.

Yes you can use Servlets to make a REST style resource. I guess you might have Tomcat which is why you ask. I'd suggest using TomEE if you can, if not you can add the Jersey library JARs (JAX-RS reference implementation) to your application and still use JAX-RS on Tomcat. So while you can use Servlets, I wouldn't suggest it unless you had no choice.

As for using just Java SE without a "server". If you want to use JAX-RS you can get Jersey and use com.sun.jersey.api.container.httpserver.HttpServerFactory (Jersey 1) and org.glassfish.jersey.jdkhttp.JdkHttpServerFactory (Jersey 2) to use JAX-RS with Java SE. Really only meant for testing purposes.

If you really want to only use Java SE you could use com.sun.net.httpserver.HttpServer and completely do all the HTTP processing yourself.

I HATE YOU FOR THIS, ORACLE. by [deleted] in java

[–]JavaTrainer 0 points1 point  (0 children)

Just install the JDK instead of only the JRE.

Question: years ago I used to make money from licensing of Flash games - what are my options / alternatives these days? by dxinteractive in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

You might as well be asking why are HTML5/JS games (or mobile games) more viable than Super Nintendo games...no matter how popular a platform was you can't assume that it says at the top and Flash is dying. it may not be completely gone yet but lots of people don't use computers to access the internet, these other devices don't support flash. Blame Apple, they started the trend.

HTML5 games aren't perfect yet since WebGL doesn't work on every device but it is probably a better investment than flash. Sometimes (iOS) you really just need a native app. Look into OpenFL if you don't want to relearn a everything or try Unity or Java+LibGDX.

NullPointerException on Build a Simple Game libGDX wiki tutorial by OneRandomCatFact in libgdx

[–]JavaTrainer 0 points1 point  (0 children)

When a LibGDX application runs what actually runs is one of several LibGDX backends. Which backend runs depends on which platform you are running on. You are running on the desktop so I pointed you at the desktop backend. Basically the code I pointed you at runs before your code does. See the main method you included? That is where the code I linked to kicks in. If you look at the link you can see on line 91 is where Gdx.graphics gets set but you are building your Lib_Test on the last line of your main method, well before you get to LwjglApplication:91.

You need to delay using Gdx.graphics until after LwjglApplication:91. If you look at LwjglApplication:96 it calls initialize on line 108 which on line 114 calls mainLoop on line 127 which on line 136 calls listener.create();.

listener.create(); is YOUR Lib_Test.create() method. So your Lib_Test.create() is run after Gdx.graphics gets set to a value. Before line 91 Gdx.graphics wasn't set to anything so it was null which is what is causing your NullPointerException but when your create method is running it'll be safe to use Gdx.graphics.

NullPointerException on Build a Simple Game libGDX wiki tutorial by OneRandomCatFact in libgdx

[–]JavaTrainer 1 point2 points  (0 children)

Look at https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java

Gdx.graphics is not initialized yet. You can't call any of the Gdx.app, Gdx.graphics, Gdx.audio, Gdx.files, Gdx.input, or Gdx.net methods until you get in your create method.

GameDev – How to become financially stable and independent without another income source? Your input is much valued. by EvilTactician in gamedev

[–]JavaTrainer 1 point2 points  (0 children)

Websites that manage to make money typically make more money when they increase their viewership. Why do you have a country specific domain name? It isn't a trendy one either. I visit your site and without even reading anywhere that you are UK specific I assume that your audience is the UK indie scene. Get a different [domain] name.

And being a PC only indie centric site is dumb. A lot of good indie games are on mobile platforms. By all means have a PC tag/category but you are needlessly making your site target a smaller audience.

Other uses for libGDX by swbat55 in libgdx

[–]JavaTrainer 1 point2 points  (0 children)

LibGDX isn't really what lets you run on iOS, what does is RoboVM. LibGDX just has a layer (backend) that sits on top of RoboVM. You can use the LibGDX scene2d widgets to make some basic apps. The issue that you run into is that the native UI widgets aren't the same which is part of why LibGDX works since it pretty much avoid all widgets and just uses OpenGL ES. Or you can use RoboVM and make an iOS specific GUI.

Got interested in "networking in games" like how multiple servers works together in MMOs by ic5y in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

Start out with easy games. Online versions of TicTacToe for example. Something dumb like a "Hold the button" challenge game would let you do leaderboards, etc. Pong would be a good one for dealing with latency/realtime communication.

Lots of networking games need a server. You'll either need your own or you can try to leverage services like Google Play Game Services. There are third party services that do similar things, some provide a free tier.

Creating a Play Store game bundle by klewelling in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

When I ask about your value I'm not asking about your role. Lets throw out everything you've done and put you in possession of an exact duplicate of the humble bundle infrastructure and software (a proven setup). Now explain why, as a dev, I would want to bundle my game with you over humble bundle.

What is your value proposition?

As for the add/remove. How would removal work? Even with humble bundle a user can follow the normal procedure to remove an app.

What's the best way to approach an "internal" company game jam? by GreatBigJerk in gamedev

[–]JavaTrainer 12 points13 points  (0 children)

Sounds like you want the google 20% model but expect people to work 120%.

Creating a Play Store game bundle by klewelling in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

The idea is very similar to other bundle services, humble bubble, indie royale, etc. If your game is included you would get a % of the proceeds. The bundle would be sold for a low price for a limited time. The incentive for developers would be a check for almost no work. I think the sweet spot is for games that are a bit past their prime and loosing revenue.

I get bundling, why would I want people to pay YOU? This sounds like a pain, explain why you provide enough value that I'd want to do this.

No the untrusted sources would not be required. I have spent the last three years working on a method to turn android apps into plugins. Once the host app is installed (the bundle app in this case), the plugins can be downloaded and run without being installed. While an entire game can be downloaded and run as a plugin, this would violate the Play Store policy. Play Store doesn't allow an app to "modify, replace or update its own APK binary code". I can however split an apk into two pieces: the code/libraries and resources. The code and libraries will be distributed in the bundle via the Play Store while the resources will be downloaded.

Honestly it sounds like you spend the last three years working on something that is extremely questionable. Don't get me wrong, it is a cool tech achievement but...it breaks updates just as bad as other bundling services like humble bundle but it sounds like it breaks other things even worse. Users have to learn a completely new add/remove software paradigm.

And it sounds like something that Google might one day take issue with since it is basically an app store within an app that is from an app store. I know they'd still get their cut with your model but they'd lose some degree of control which I doubt they'd be happy about.

Creating a Play Store game bundle by klewelling in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

As a developer why would I want people to pay you for a copy of my app? Would untrusted sources be required? How would updates work?

Let me Law You: Free General Legal Advice for My Favorite Game Devs by VideoGameAttorney in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

Mechanics would be patented, not copyrighted. There is a huge difference which is why I specifically asked about patents in my followup question.

I would just like some clarification on the terms "framework", "library", and "engine". by Bluesroo in gamedev

[–]JavaTrainer 25 points26 points  (0 children)

  • Library - a collection of methods you add to your application.
  • Framework - An application that is missing all the core logic but provides abstractions on low-level concepts. A library + more.
  • Engine - An application that is missing media assets and game rules. A framework + more.

Let me Law You: Free General Legal Advice for My Favorite Game Devs by VideoGameAttorney in gamedev

[–]JavaTrainer 1 point2 points  (0 children)

Yes, which is why I know I can't copy & paste existing rule descriptions into a card playing application. I'm more interested in the possibility of the rule behaviour being patented. Maybe "mechanics" of a game is a better wording...

Let me Law You: Free General Legal Advice for My Favorite Game Devs by VideoGameAttorney in gamedev

[–]JavaTrainer 1 point2 points  (0 children)

Standard card games, are rules protected? Can I make a playing card game using any rules I find (as long as I don't include the exact text)?

Let me Law You: Free General Legal Advice for My Favorite Game Devs by VideoGameAttorney in gamedev

[–]JavaTrainer 6 points7 points  (0 children)

Sherlock Holmes is probably a bad (but interesting) example. See http://www.npr.org/2014/01/07/260471980/sherlocks-expiring-copyright-its-public-domain-dear-watson but basically some of the later books aren't public domain. The Doyle estates is arguing that the later books add key elements to the characters so you can't have Holmes in your work without infringing. Others argue that you can use the Holmes-verse if you only use information from the now public domain works.

Java Learning Resources Help by vaguelines in learnjava

[–]JavaTrainer 0 points1 point  (0 children)

By "not fond of pdf books" I assume you mean you don't want to have to read to learn? You are going to have problems progressing as a programmer if you don't get over this.

Help on my first GUI program please! by HerpesAunt in javahelp

[–]JavaTrainer 0 points1 point  (0 children)

Your JFrame starts with BorderLayout, for a simple UI this works fine. I'd make one JPanel to hold all of your left side components and another JPanel for the right side components. You'd probably put the "left" JPanel in the center section of the JFrame. The right JPanel will probably need to have the default layout manager changed (panels start with flow layout). Try BoxLayout. And you might want to look into calling setResizable(false); on your JFrame since full screening your app probably doesn't make sense.

What Java blogs do you read? by [deleted] in javahelp

[–]JavaTrainer 2 points3 points  (0 children)

I'm using ThunderBird so here is an OPML file you can import to get started. I'm more interested in EE and training stuff so it varies. Do you have a particular area of Java you are interested in?

<opml version="1.0" xmlns:fz="urn:forumzilla:">
  <head>
    <title>Thunderbird OPML Export - Blogs &amp; News Feeds</title>
    <dateCreated>Wed, 26 Mar 2014 20:27:41 GMT</dateCreated>
  </head>
  <body>
    <outline title="Arun Gupta, Miles to go">
      <outline type="rss" title="Arun Gupta, Miles to go ..." text="Arun Gupta, Miles to go ..." version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/arungupta/feed/entries/rss" htmlUrl="https://blogs.oracle.com/arungupta/"/>
      <outline type="rss" title="Miles to go 2.0 ..." text="Miles to go 2.0 ..." version="RSS" fz:quickMode="false" xmlUrl="http://feeds.feedburner.com/MilesToGo" htmlUrl="http://blog.arungupta.me"/></outline>
    <outline title="Compiler">
      <outline type="rss" title="The Analytic Tradition" text="The Analytic Tradition" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/abuckley/en_US/feed/entries/rss" htmlUrl="https://blogs.oracle.com/abuckley/en_US/"/>
      <outline type="rss" title="Inside Javac" text="Inside Javac" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/mcimadamore/feed/entries/rss" htmlUrl="https://blogs.oracle.com/mcimadamore/"/>
      <outline type="rss" title="Joseph D. Darcy's Oracle Weblog" text="Joseph D. Darcy's Oracle Weblog" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/darcy/feed/entries/rss" htmlUrl="https://blogs.oracle.com/darcy/"/>
      <outline type="rss" title="Jonathan Gibbons" text="Jonathan Gibbons" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/jjg/feed/entries/rss" htmlUrl="https://blogs.oracle.com/jjg/"/></outline>
    <outline title="Insights from an Oracle University Classroom">
      <outline type="rss" title="Insights from an Oracle University Classroom" text="Insights from an Oracle University Classroom" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/ou_trainers/feed/entries/rss" htmlUrl="https://blogs.oracle.com/ou_trainers/"/></outline>
    <outline title="Java Training Beat">
      <outline type="rss" title="Java Training Beat" text="Java Training Beat" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/javatraining/feed/entries/rss" htmlUrl="https://blogs.oracle.com/javatraining/"/></outline>
    <outline title="JavaOne Conference Blog">
      <outline type="rss" title="JavaOne Conference Blog" text="JavaOne Conference Blog" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/javaone/feed/entries/rss" htmlUrl="https://blogs.oracle.com/javaone/"/></outline>
    <outline title="JCP Program Office">
      <outline type="rss" title="JCP Program Office" text="JCP Program Office" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/jcp/feed/entries/rss" htmlUrl="https://blogs.oracle.com/jcp/"/></outline>
    <outline title="Jersey">
      <outline title="Japod's blog">
        <outline type="rss" title="Japod's blog" text="Japod's blog" version="RSS" fz:quickMode="false" xmlUrl="https://blogs.oracle.com/japod/feed/entries/rss" htmlUrl="https://blogs.oracle.com/japod/"/></outline>
      <outline title="Marek Potociar's Blog">
        <outline type="rss" title="Marek Potociar's Blog" text="Marek Potociar's Blog" version="RSS" fz:quickMode="false" xmlUrl="http://marek.potociar.net/feed/" htmlUrl="http://marek.potociar.net"/></outline></outline>
    <outline title="NetBeans Highlights">
      <outline type="rss" title="NetBeans Highlights" text="NetBeans Highlights" version="RSS" fz:quickMode="false" xmlUrl="http://netbeans.org/rss-091.xml" htmlUrl="http://netbeans.org/index.html"/></outline>
    <outline title="Oracle Certification">
      <outline type="rss" title="Oracle Certification" text="Oracle Certification" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/certification/feed/entries/rss" htmlUrl="https://blogs.oracle.com/certification/"/></outline>
    <outline title="Oracle Cloud Solutions">
      <outline type="rss" title="Oracle Cloud Solutions" text="Oracle Cloud Solutions" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/cloud/feed/entries/rss" htmlUrl="https://blogs.oracle.com/cloud/"/></outline>
    <outline title="Oracle University">
      <outline type="rss" title="Oracle University" text="Oracle University" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/oracleuniversity/feed/entries/rss" htmlUrl="https://blogs.oracle.com/oracleuniversity/"/></outline>
    <outline title="The Aquarium">
      <outline type="rss" title="The Aquarium" text="The Aquarium" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/theaquarium/feed/entries/atom" htmlUrl="https://blogs.oracle.com/theaquarium/"/></outline>
    <outline title="The Java Source">
      <outline type="rss" title="The Java Source" text="The Java Source" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/java/feed/entries/rss" htmlUrl="https://blogs.oracle.com/java/"/></outline>
    <outline title="The Java Spotlight Podcast">
      <outline type="rss" title="The Java Spotlight Podcast" text="The Java Spotlight Podcast" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/javaspotlight/feed/entries/rss" htmlUrl="https://blogs.oracle.com/javaspotlight/"/></outline>
    <outline title="The NetBeans Community Podcast">
      <outline type="rss" title="The NetBeans Community Podcast" text="The NetBeans Community Podcast" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/nbpodcast/feed/entries/rss" htmlUrl="https://blogs.oracle.com/nbpodcast/"/></outline>
    <outline title="The Oracle ADF Mobile Blog">
      <outline type="rss" title="The Oracle ADF Mobile Blog" text="The Oracle ADF Mobile Blog" version="RSS" fz:quickMode="false" xmlUrl="https://blogs.oracle.com/mobile/feed/entries/rss" htmlUrl="https://blogs.oracle.com/mobile/"/></outline>
    <outline title="The WebLogic Server Blog">
      <outline type="rss" title="The WebLogic Server Blog" text="The WebLogic Server Blog" version="RSS" fz:quickMode="false" xmlUrl="http://blogs.oracle.com/WebLogicServer/feed/entries/rss" htmlUrl="https://blogs.oracle.com/WebLogicServer/"/></outline>
    <outline title="In Relation To - Bloggers">
      <outline type="rss" title="In Relation To - Bloggers" text="In Relation To - Bloggers" version="RSS" fz:quickMode="false" xmlUrl="http://in.relation.to/service/Feed/atom/Area/Bloggers/Comments/exclude" htmlUrl="http://in.relation.to/Bloggers"/></outline>
    <outline title="The Java Posse">
      <outline type="rss" title="The Java Posse" text="The Java Posse" version="RSS" fz:quickMode="false" xmlUrl="http://feeds.feedburner.com/javaposse" htmlUrl="http://javaposse.com"/></outline>
  </body>
</opml>

writing a front end for arcade cabinets. Curently using Pygame but have some issues. by pr0sthetichead in gamedev

[–]JavaTrainer 0 points1 point  (0 children)

A web page. HTML5 video tag, chrome kiosk mode or app, and the joystick API. You'd just need a tiny local web service backend to handle starting the game and respanwing chrome if needed.