I have a game based on libgdx that's hosted online.
It runs great on desktop but on mubile it depends on the phone's size.
The game is usually a bit too big and it's quite some trouble to try to make it fit the whole screen.
I have an option to put the game fullscreen, but I'd like for the game to automatically be fullscreen IF it's online AND on a mobile device.
However I haven't found anything to help me with that in libgdx's library, any ideas?
(edit, added code, I didn't show code in the first place because the solution may be in doin php redirection if there's nothing better... then I'd have 2 version of the code, one for desktop and the other one would automatically be fullscreen, for mobile... but having all the source code twice just for an "if" looks overkill to me...)
Here's how I can see wether the game runs on a web page, android or desktop :
(Gdx.app.getType() == ApplicationType.WebGL)
But more then knowing that it's on WebGL, I want to know if the web page ran from a cell phone or tablet or from a desktop.
thanks
Related
I am very new to Intel XDK.
To build my initial concepts, I made a very simple html 5 hello world page and it is working fine when running under EMULATE tab.
I build the app for Android, email to my address, download on mobile and installed it as well.
But after installation, when I start the application, it shows the first page with title "Html5 App Development" and then a blank White screen, that's it, I am not able to view my index.html page on the mobile.
What am I doing wrong here?
I hope that by now you have solved the problem but in case other people run into this thread. We had the same issue at times with our app until we tracked down the problem to the way the init and document ready gets fired.
Tweaking with the document ready features did the trick for us.
It sounds like you probably have it drawn at some point offscreen, due to the pixels rendered in the display vs actual pixels.
Try setting the viewport/screen size to handle this: https://gamedev.stackexchange.com/questions/70700/viewport-pixels-trouble-intel-xdk
I am building a website for a friend and it's just about done, apart from a bit more content, but now he tells me that it doesn't look right on his iphone. I have checked it on Safari, Opera, IE, Chrome and Firefox on laptop, and on my Android phone and on web-based iphone emulators and everything looks fine. I had him check on someone else's iphone and 1 of the problems goes but the other remains. My site is pretty basic, html and css only, but I am the first to admit that as I am new to this my code could probably be better.
The first issue is that above the header his iphone shows there are what's best described as 5 red bricks evenly spaced along the top. This doesn't show on his mates iphone.
The second issue is that on the "products" page, the right column text under the pictures isn't lined up properly, which is the case on his mates iphone. I don't know what to do here because if I alter the padding I used to line things up, it won't be right on every other browser/device.
I'm not sure what I'm best posting on here, the whole code for the site seems too much, but whatever needed to help answer just let me know. The site address for the products page is http://www.doortodoordrinksyork.com/products.html
Like I say I'm new to this so please keep answers simple.
Thanks in advance.
David.
PS Would appreciate anyone with an iphone telling me how the site displays on it.
If you use a Mac, you can use the iOS Simulator tool that comes with XCode to test out your site in a virtual iPhone/iPod. You can even compare different versions of the built-in browser, which I think is what's causing the difference between your mate's devices.
In general, well-built sites will 'work' without modification on mobile devices, but you may want to look into media queries, a CSS feature that lets you target specific screen sizes with different rules.
I'm using win7.
and i have website which i want to test it with iPhone browser environment.
which it's use most flash (jISFR).
this is the website i talking for,
http://www.hamuranalodge.com/
may you can see menu navigation is using flash jSIFR, which it's seems not work in iPhone, and want to fix it. of course i need iphone Testing for it.
Is there somebody know how i can test it with iphone browser?
may there is a software can do it?
or a website give service like that?
Thanks
Not a perfect solution but you might be able to test it on the Android browser instead. The SDK runs on all major OSs and is free to download and install. Just make sure that flash support is turned off. I'm pretty sure iPhone and Android both use WebKit so you should get similar behaviour on both.
You could use the iPhone simulator if you have access to a Mac.
There are sites like this:
http://www.testiphone.com/
but this one doesn't work very well, at least not for this particular request. Go there and point it at www.worldsbk.com - it renders the Flash block on the top right hand side just fine on my desktop computer (Firefox3 Mac OS X), but have a look here:
http://www.flickr.com/photos/bigiain/5037577763/
to see a screen grab of that page from my iPhone... Note the big grey block where the flash bit should be...
I have developed a website in asp.net for iPhone.
Now I am stuck in how to deploy that site on the iphone?
Never done it before.
How to make it iphone ready so the device can access the site ?
Any ideas...
Thank you All.
Social Circus, as Mehrdad says you don't need to change anything to allow users with iPhones to access your site; iPhones use a mobile version of Safari that renders pretty much everything like a normal desktop browser. There are a few things worth noting however if you want iPhone users to have a good experience browsing your site:
No Flash. If you've used Flash at all in your site it won't work on iPhones (or most other mobile platforms).
The resolution of the iPhone is 320x480. The top and bottom bars will take off a minimum of 20+44 = 66 pixels. You could implement a CSS template that re-formated everything into 320 pixel width but this is a lot of work. See something like Google Mail in an iPhone browser for an example.
iPhone users will be able to add a shortcut to your webapp on their desktop, with a name they want, so the actual URL matters less from this perspective.
Finally, it's worth noting that many iPhone users think of webapps as a bit "passe" - a bit old (man that's sooo 2008!). This isn't really fair but it's mostly true. With 65,000+ apps on the app store no-one's going around looking for webapps any more. For a better chance of adoption, especially if it's something like a game, perhaps look at using the SDK to write an iPhone-specific version? (quite a lot of work usually!!)
Hope that helps
Copy the stuff to the Web server, setup the databases if necessary, just as you'd do for a Web app designed for desktop browsers. Is this a real question?
I'm looking at prototyping with a HTC Advantage, which runs Windows Mobile 5 and has a screen resolution of 640x480 (or the other way if in portrait).
Before anyone jumps in and suggests developing as a native Windows mobile app, we're prototyping as a Java midlet because we also want to find out what restrictions/limitations/design considerations there are if we decide to then take the code to run on other mobile platforms: Java allows us the largest mobile-base with fewer code changes.
I'm using Netbeans 6.8 for the development, and I can't see any way to change the "Device Screen" view of a midlet from a typical mobile-phone sized screen, nor change the view from Portrait to Landscape; similarly, the emulator doesn't have a large-resolution device.
I'm using the default mobile device of ClamshellCldcPhone1. I've looked at some of the other device profiles, but none of them seem to be targetting larger screen devices from what I can see. And I can't find any documentation that tells me the difference between, say, ClamshellCldcPhone1 and DefaultCldcPhone2.
Has anyone any experience of this? Most of the existing things I've read have said to design for the smaller resolution and use anchoring to ensure controls stay in place; however as I've got a screen that's twice the resolution, I want to write for that resolution (given this is currently in prototype world). I can copy the code over to the HTC device to test, but this will (probably) get painful, especially during the early stages.
Any advice welcome :-)
What you need is a new emulator configuration for your handset form factor.
The emulator in Netbeans is the same as the J2ME SDK (formerly Wireless ToolKit, hence the WTK acronym) from SUN Ltd.
You can make a copy of the ClamshellCldcPhone1 folder that is presumably located inC:\Program Files\NetBeans 6.8\mobility8\WTK2.5.2\wtklib\devicesand modify the images and .properties file in your new configuration to match the device you want to emulate.
You can add/remove physical keys, resize the screen and make it touchscreen that way.
This should all be explained in the J2ME SDK documentation.
It's been a very long time since I did any of this, but I think you can just copy one of the existing profiles, rename it, and change the settings to what you want.