Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by 1508985 · Feb 11, 2018 at 09:32 AM · apissdksContent

Java API - Stupid question

Hi, I am wondering how to code PlayFab into a game that I am working on in Java, I've tried using javascript within Java but I am just getting javax.script.ScriptException: ReferenceError: "XMLHttpRequest" is not defined in <eval> at line number 60

Any help for an idiot that has no idea how to code this?...

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Feb 11, 2018 at 11:37 PM

XMLHttpRequest is a JavaScript component in web browsers. If you're developing in straight Java, I'd recommend using this guide: https://api.playfab.com/docs/getting-started/java-getting-started.

Comment

People who like this

0 Show 7 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 1508985 · Feb 14, 2018 at 09:32 PM 0
Share

@Brendan thanks, I have been looking through the link and I was still unable to find any examples except from the creation of a new user. Is there any additional guides that show code examples for GetTitleData etc for use within the games.

avatar image Brendan ♦♦ 1508985 · Feb 15, 2018 at 01:25 AM 0
Share

We have a number of examples in our tutorials (like this one: https://api.playfab.com/docs/tutorials/landing-content/using-title-data), but all the API calls are simple Web API endpoints, so effectively they're all basically the same, in how you construct them. We'll be adding more tabs to the examples in the tutorials as soon as we can.

avatar image 1508985 · Feb 15, 2018 at 07:24 AM 0
Share

@Brendan sorry, I’m still being blank with how to make these work with Java.

When I call any of the methods it just gives me syntax errors, any code snippets written in Java would be amazing.

Sorry,

Thank you for all your help

avatar image Brendan ♦♦ 1508985 · Feb 15, 2018 at 08:37 AM 0
Share

Can you provide the details of the calls you're making, and the responses?

avatar image 1508985 · Feb 15, 2018 at 01:53 PM 0
Share

@brendan my current ideas is to have the game pull down the game title information for global stuff like screen size and the game FPS. Then use the user data to store things like ammo, score and level. Then write the user data back to playfab after each level.

Sorry I’ve never used PlayFab before so I’m not used to how you build constructors for the functions

avatar image 1508985 · Feb 15, 2018 at 01:53 PM 0
Share

@Brendan

Basically, I'm needing to know how to pull player inventory in Java and how it will be saved.

How to run cloud scripts and get return values.

Pull Game Title information

avatar image Brendan ♦♦ 1508985 · Feb 16, 2018 at 02:11 AM 0
Share

What you'll want to do is use our Java SDK (https://api.playfab.com/docs/getting-started/java-getting-started) and make the calls the way shown in the readme of the GitHub repo containing the SDK - look below where it says "Set up your first API call". All the parameters for the calls are defined in our documentation, to help make this simple.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    How to Upload and Download a file with the C++ SDK? 2 Answers

    CDN files upload with nodejs script and https 2 Answers

    Display Properties for User Generated Content? 1 Answer

    How to download content from cdn? 1 Answer

    Having trouble with Get content from CDN to Update my game's version in Unreal Engine 4 0 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges