Netbeans, mobile development and screen size - netbeans

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.

Related

How to connect to an iphone through Java? Is this even possible?

I am trying to write a program in Java that can connect to an iPhone that is attached to a computer via apple USB cable and view its files. I have not found anything like this online and have been wondering if this is even possible. Any suggestions?
iOS is problematic because of DRM. Android is also moving in that direction making standard file system browsing difficult so I doubt it would be possible to view arbitrary files on the device.
Codename One allows you to build a Java app that will run on the iPhone itself which might allow you to access some data. However, apps running in the device also have restrictions and can't access the full file system only their own.

Best method for testing viewport and scaling in iPhone and iPads

I'm looking for a way to test my web layouts for mobile devices without having to buy the actual hardware. I'm primarily interested in testing for the iPhone and the iPad. I own an iPhone and so can do a proper test there. But I'm unable to know for sure what it looks like on the iPad. Either way: it would be nice to check the visual output on my Mac as I'm building it for productivity sake.
testiphone.com is supposed to simulate the appearance of a website, but there is a difference in rendering the layout scale: On my iPhone hardware, the content's width is scaled to fit the left and right margins of the screen. In the testiphone.com simulator, the content is not scaled at all.
So does there exist a method that can test visual layouts consistently?
(I'm not opposed to subscribing to the Developer SDK, but if there's a faster and easier way to get the viewport and scaling to behave consistently, I would prefer it!)
You can download an SDK with a free developer account. You will not have access to beta versions, but you won't need them for testing web layouts. Go to http://developer.apple.com/ios and click the link for "XCode and iOS SDK". It will ask you to log in with your apple id, and set up a free developer account if it isn't registered with one. Then, use the iPhone Simulator application to test your website.

iPhone Browser Live Testing

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...

How to port existing iPhone application to iPad

I have an iPhone application, now i want to convert that application to a universal application which runs on all the devices iPhone/iPod/iPad.
So, where to start, what things i need to do?
Any help, link, sample app, anything, will be highly appreciated.
Thanks in advance :)
I've done that recently, it's actually much simpler than it would seem. I recommend you read the iPad programming guide from Apple, it's about 100 pages in PDF (and you don't need to read all of it). Basically, you need to:
run a command in Xcode that automatically converts your project to Universal
add support for orientation changes, if you haven't done that earlier (it's required on iPad)
go through the app, see what's broken and fix it (e.g. it's likely that you'll see some places where you need to fix autoresize settings for controls)
That's of course if you don't want to redesign the UI for iPad, which you'll probably want to do in the end (e.g. use split views, popup dialogs and various modals, and do less full screen view transitions). The UI that you'll get by going through this steps won't feel 100% iPad-y, but it will work, and will look much better than an iPhone-only app zoomed in, so it's a good start.

What debugging techniques do you use for iPhone/iPod web development?

I'm working on a web application, and we are targeting the iPhone and iPod Touch. I'm familiar with the debugging tools for FireFox and IE (e.g. Firebug and IE Developer Toolbar), but I can't find anything for the iPod. I am not looking forward to using alert as my main debugging tool, especially when I expect mouse events to be one of the major issues.
Is this really the state of the art? What tools do you recommend?
Also, how similar is the html layout on an iPhone to that of Safari running on Windows? On a Mac?
The iPhone version of Safari includes a debug console that can be very handy. Settings > Safarai > Developer.
You can also use the Simulator in the iPhone SDK. There's no extra debugging, but it's easier than using a physical device all the time.
You can also use the desktop version of Safari for many things.
The web tools that target the iPod Touch and iPhone arenas include
[iPhone Remote Debug Console](
http://code.google.com/p/iphonedebug/)
BlackBaud Simulator for Windows
[MobileSafari Simulator](
http://www.testiphone.com/)
[iPhoney](
http://marketcircle.com/iphoney/)
While WebKit has a remote inspector, it is hard to enable on an actual iOS device (at least without jailbreak) and so most tools for it are simulator-only. iWebInspector looks promising for this, but keep in mind the simulator's WebKit library is not identical to the device's.
That's where weinre comes in. With weinre, you can "debug a web page displayed on your phone from your laptop". How it works is you run its custom HTTP server that hosts two things:
a JavaScript file you include on the page you want to debug
an Inspector page that you load on the machine you want to debug from
You start the server e.g. java -jar Downloads/weinre.jar --boundHost -all- --httpPort 4242 and then put a script tag like <script src="http://weinre-server-name.local:4242/target/target-script-min.js"> in the source code for your webpage and load the inspector by navigating to e.g. http://weinre-server-name.local:4242/client. When you load the target page on an iPhone on your local WiFi connection, the connection will show up in the client page on your mainframe and you can use the Inspector tabs to view/edit the page on the iPhone.
It has some limitations (no Javascript breakpoints and such) and can be a little laggy, but overall it's pretty magic.
There is also a nice tool called iWebInspector
http://www.iwebinspector.com/