Menu (Command) using J2ME Polish and Generic MPDP2 build - user-interface

I am using J2ME Polish for my application. The app itself is fairly simple but we are using polish for it's nice UI. I would like to have a popup menu (Command) that is similar to the picture attached. I am able to get this kind of UI for device specific builds, such as Nokia 6212 Classic but not for Generic MIDP2 builds.
I believe everything is being rendered on J2ME Canvas and I don't see any technical reason why this cannot be rendered for a generic device. Could anyone out there let me know if this is not possible by design?
Any pointers on how to get this working is appreciated. Thanks.

I have found the solution after going through the document 'Complete guide to J2ME Polish, The solution for professional wireless Java development", which I highly recommend for anyone making use of this library.
J2ME Polish supports "menu" mode when the device has a feature "hasCommandKeyEvents". This is available by default when you are developing for a device that is already present in the device database (devices.xml and other related xml files). But if you are developing for a custom device, this feature needs to be set for the device definition. For example, I am developing for ALL Nokia S40, S60 devices. Add the following entry in the file custom-devices.xml.
<device supportsPolishGui="true">
<identifier>Nokia/Midp2CCLDC11</identifier>
<groups> Series60,Series40</groups>
<capability name="ScreenSize" value="240x320"/>
<capability name="FullCanvasSize" value="240x320"/>
<capability name="CanvasSize" value="240x320"/>
<capability name="BitsPerPixel" value="16"/>
<capability name="JavaPackage" value="mmapi1.1, wmapi, wmapi2.0,m3g, pdaapi, nfc" />
<capability name="JavaPlatform" value="MIDP/2.0" />
<capability name="JavaConfiguration" value="CLDC/1.1" />
<capability name="JavaProtocol" value="http, https, ssl, tls, tcp, udp" />
<capability name="HeapSize" value="10 MB" />
</device>
Build for this device Nokia/Midp2CLDC11. The UI would now show the menu.

Related

CipherLAB - Barcode scanner event - xamarin.forms

Hello I get CipherLap 'smartphone' with laser barcode scanner. This scanner is working like keyboard. My goal is to write simple app to read example data and valid it. This what I have done is:
Made an <Entry /> and hide it.
On start view I Focus() entry, click scan and TextChanged event write it to my <Label />
But after all its not rly smart and my question is. Is in xamarin.form any better way do get example data without using and hiding <Entry /> ?
ps. It also pop keyboard on screen and its also a bit annoying.
Usually these rugged smartphones, that includes a barcode scanner, make available some sort of SDK to integrate barcode scanning capability in third-party applications.
I don't have much experience with CipherLab (I work for Zebra Technologies and we've different SDKs available including one for Xamarin).
Looking on Cipherlab website I've not been able to find any SDK but you should contact the company that sold you the device.
I realise this is late but it may help others.
A Xamarin component/plugin/whatever they call it now would need to be implemented. Cipherlab mentioned plans for this but I don't know what happened.
You could look at my react native plugin to help you get started.
https://github.com/mribbons/react-native-cipherlab-scanner
You can also contact your supplier to get a copy of the sample native application.
It would be great if Cipherlab made this available publicly.

App not compatible with tablet

I've build an Android app...for phones...but I wouldn't mind to broaden my audience and let Tablet owners download it as well....
To be honest. it doesn't look very neat on a tablet...but I don't really mind that. I'll at least give them the option.
unfortunately I cant find the app on the Google Play Store / Android Market with my tablet! when I launch the url directly in the browser, I am being redirected to the Play store, but it says "this app is not compatible with your device"
I didn't specify anything in my Manifest like "android:xlargeScreens" (the default should be true, right?
I also didn't specify any device restrictions in the Store Publish page
Unfortunately I only have one tablet to test it with...so I don't know if it's the tablets fault, my apps fault or the Play Store's fault....
I have an HP Touchpad (CM9)....it's rather experimental device - but other phone apps works without a problem on that device
while developing, I also used my tablet as a test device, and the app launched on it. so I don't really know why the Play Store is forbidding me to download the app....
are there any special requirement that my Manifest or my XML-layouts have to match, for the Play Store to open it for tablet users as well?
The tablet may not support some of the features that your app requires. You can make them "not required" for the app (that means that you should check if they are actually available before using them in the code).
It is done like that:
<!-- features -->
<uses-feature android:name="android.hardware.telephony" android:required="false" />
Other possible features are:
android.hardware.camera
android.hardware.camera.autofocus
android.hardware.location.gps
android.hardware.location
android.hardware.location.network
For full list of relations between features<->permissions, you can see:
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
See "Feature reference"
write below code into your android manifest.xml file for make application tablet compatible.
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
I solved my own problem:
I did 2 things:
1 - I disabled 'touchscreen'
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
this disables ADVANCE touchscreen controls (like flicking etc.)
but I think the thing that did it was the following:
2 - I disabled the Copy Protection in the Play Store Publish page
a few hours later I could find my app on my tablet and install it!
Android documentation clearly mentioned that if your app supporting v3.1+ then you should have tag in AndroidManifest.xml
http://developer.android.com/guide/practices/screen-compat-mode.html

WP7 BackgroundAudioPlayer plays only while attached to debugger

I'm working on music app for WP7. It downloads music from our servers in form of little segments (each track is devided into 128k encrypted pieces). I'm using AudioPlayerAgent and AudioStreamingAgent to download, decrypt and play music.
Everything works fine, while I start application from visual studio via F5. When I start app from menu on emulator or device, everything works fine except of music is not playing. BackgroundAudioPlayer never starts. Doesn't metter if I try debug or release build, or if I try it on emulator or real device(Nokia Lumia 710 and HTC HD7 Pro).
I think that I have everything correctly setted up in AppManifest:
<Capabilities>
<Capability Name="ID_CAP_GAMERSERVICES" />
<Capability Name="ID_CAP_IDENTITY_DEVICE" />
<Capability Name="ID_CAP_IDENTITY_USER" />
<Capability Name="ID_CAP_LOCATION" />
<Capability Name="ID_CAP_MEDIALIB" />
<Capability Name="ID_CAP_MICROPHONE" />
<Capability Name="ID_CAP_NETWORKING" />
<Capability Name="ID_CAP_PHONEDIALER" />
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
<Capability Name="ID_CAP_SENSORS" />
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
</Capabilities>
<Tasks>
<DefaultTask Name="_default" NavigationPage="Panorama.xaml" />
<ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="AudioPlayerAgent" Name="AudioPlaybackAgent1" Source="AudioPlaybackAgent1" Type="AudioPlaybackAgent1.AudioPlayer" />
<BackgroundServiceAgent Specifier="AudioStreamingAgent" Name="AudioStreamAgent1" Source="AudioStreamAgent1" Type="AudioStreamAgent1.AudioTrackStreamer" />
</ExtendedTask>
</Tasks>
After some research I found that I can enable hidden console for emulator to see debug log. I tried to track what happens when I start app from emulator menu. In point where BackgroundAudioPlayer should start playing track following message appers:
PID:0E8500C6 TID:0EEE006A Sentinels are Disabled for all processes.PID:0E8500C6 TID:0EC500DE Exception 'Raised Exception' (0xc0008005): Thread-Id=0ec500de(pth=c0654930), Proc-Id=0e8500c6(pprc=c05f3160) 'HeadlessHost.exe', VM-active=0e8500c6(pprc=c05f3160) 'HeadlessHost.exe'
PID:0E8500C6 TID:0EC500DE PC=42a629f7(mscoree3_7.dll+0x000529f7) RA=42ac3ae5(mscoree3_7.dll+0x000b3ae5) SP=0634f6b8, BVA=00000000
I also tried to test app in MarketplaceTestKit if any unsupported Api is causing it, but app passed all test fine.
So my question is: does anybody know, while app is playing only when attached to debugger?
Thank You,
Jan.
You should only have one type of background audio agent in your app.
Based on your description of how you're getting the tracks, it seems that using the streaming agent will be more appropriate.
If you're playing each segment directly (treating it as a separate track) and there isn't an issue with gaps as you switch between segments (tracks) then you could use the playback agent.
Having multiple background audio agents specified can cause your app to crash. Note. You'll have to edit the WMAppManifest file directly to remove the one you don't want.

Get "An unexpected error has occurred." when using MediaLibrary.GetPictureFromToken 500+ pictures on phone

i get "An unexpected error has occurred." when using MediaLibrary.GetPictureFromToken(String token). Has any one the same Problem?
Device: HTC Mozart
I was getting this as well, and after some digging, it's because I didn't have the ID_CAP_MEDIALIB turned on in the App Caps.
<Capabilities>
<Capability Name="ID_CAP_LOCATION"/>
<Capability Name="ID_CAP_NETWORKING"/>
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
<Capability Name="ID_CAP_GAMERSERVICES"/>
<Capability Name="ID_CAP_MEDIALIB"/>
</Capabilities>
Welcome to the wonderful and exciting world of "Media" programming on WP7.
You cannot access the WP7 Media library while debugging a WP7 device that is connected to Zune. The exception you described is the exception you'd normally see in this situation. You have 2 options:
Close Zune, and start WPConnect instead. That should allow you to debug from Visual Studio without Zune. And it even supported Media apps. the file is located on my machine # C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect\WPConnect.exe
Consider using the unlocked emulator ROM for debugging the Pictures hub in the emulator.
Could it be that your phone has run out of storage space if you've been generating a lot of data/pics/etc?
You can check this in Settings | About.

Silverlight 3 on Mac OS X in Firefox 3.5 doesn't work!

I'm trying to upgrade my site to Silverlight 3. All my customers are having a reasonabily good experience from upgrading to Silverlight 3 from Silverlight 2 or just a fresh install.
But on Mac OS X in Firefox 3.5, after Silverlight is installed they cant view any Silverlight apps, it's just blank on screen. No errors, I can right click on the app and access the Silverlight Preferences etc, but nothing renders. But it works absolutely fine in Safari.
Has anyone else had this problem?
BTW, I have also restarted the machine, but no luck.
Cheers,
Ash.
There was a fourth way :
in the object parameters where u have width and height, just set height to a fixed size in pixels.
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="600px">
it will appear correctly now on Firefox.
The problem stay a bug but u can use that work-around.
The problem in the future will be to define the host div height dynamically if the silverlight height change while using it.
Solution 2, use w3c platform : My website respect w3c already but difficult to use dynamic functions like for a business app in Xhtml, Ajax and Css alone.
Solution 3, do not use Firefox : Sorry here too, 30% peoples using that browser and for the website i am making, it is potential customers.
I will follow the bug as i do currently, help and wait a little while continue using silverlight and keep first option :)
Thanks for your answer.
I traced the bug here => https://bugzilla.mozilla.org/show_bug.cgi?id=506231
I had the same issue with Silverlight not displaying content (Mac OS 10.5.8, FireFox 3.6.10). To solve the problem, I disabled my Firebug extension and restarted the browser. Hope that helps.
It works fine in Firefox 3.5 on OS X (10.5.7). Check if you have the Silverlight Firefox plugin disabled.
Working Silverlight 3 on OS X in Firefox 3.5 http://img148.imageshack.us/img148/3585/picture1jcf.th.png
Same for me, when i use plain aspx page to host silverlight 3 control it works :
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication2.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
But when i include my silverlight object (inside aspx page) between another div (to resize or nothing else for example), i got a blank page under firefox 3.5 :
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication2.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div></div>
Do the test by yourself with a new VS project.
Other browsers (opera, chrome, ie, safari) display the SL control correctly.
It looks like javascript problem, but currently do not know where...
This is a known problem and you've basically got three options;
Keep on developing with Silverlight and expect these kind of problems surfacing frequently in the future - even if you can get your application to work this time, it'll still surface later down the road every once in a while.
Port your application to the W3C platform (ECMA, CSS, (X)HTML) utilizing some sort of Ajax library - and hence get rid of the problem permanently.
Entirely drop any non-Microsoft based OS support for your application. Silverlight will occasionally and partially work with many non-Microsoft based Operating Systems, but once Microsoft have acquired the market share they want for Silverlight they will have no financial incentives in getting Silverlight to work with neither Mac OS X, Linux, Symbian, iPhone or any other Operating Systems in this world not created by themselves - in fact their financial incentives will be in getting it NOT to work on non-MS based Operating Systems since this will drive adoption of their Operating Systems like Windows 7, WindowsMobile etc. For you to follow this strategy is obviously quite dangerous since Microsoft is bleeding market shares to Linux and especially Mac OS X on the client. Not to mention that they have probably less then 1% of the mobile phones in this world. Which all together translates into less customers (users) for your applications. But if you can be positively certain about that your customers are purely going to want to use your applications with Microsoft based Operating Systems, then I guess it doesn't matter that much for you...
I know it sounds drastic, but the "object tag" should have been the clue-giver here. Silverlight is nothing but ActiveX in a new wrapping with a new name and some new fancy colors - or ActiveX2.0 if you wish. And we all know how ActiveX1.0 worked...
Microsoft have created some spectacularly great innovations through out their history, the .Net Framework and the C# language being one of them, but neither ActiveX1.0 nor ActiveX2.0 are among those great innovations. Silverlight is kind of like the "Windows Millennium of Frameworks" - buggy, expensive and gives few if any benefits to its users. But comes wrapped inside a beautiful package that makes people "buy into it"...

Resources