How to create a class dynamically in a Blackberry project that uses Eclipse plugin? - blackberry

How to create a class dynamically in a Blackberry project that uses Eclipse plugin?
My requirement: Suppose on click of a button a new class with a given name should be created. Methods and fields should be added and
then I should make use of that class
object. Is this possible in Blackberry?
Below are the steps I have done.
Get third party jars like ASM, javassist
Try to use them in project
but, I am getting verification errors when deploy to the device. So, is there a native api in RIM or any other alternative?

BlackBerry Java does not support the full set of reflection capabilities that you would expect in Standard Java (J2SE).
So, you won't be able to dynamically create a class, add methods, and then call them.
For the most part, BlackBerry is Java 1.3. If you tweak your development environment, you can get access to some newer features at compile time. But, in terms of the runtime code, you're limited to 1.3.
Javassist is based on Java APIs that don't exist in the 1.3 runtime that BlackBerry has, so it won't be of much help :(
Hopefully, someone else will chime in, but I don't know that this is something that's possible on BlackBerry Java.

Related

What is the difference between a unity plugin and a dll file?

i am new to Unity and i am try to understand plugins. I have got the difference between a managed plugin and a native plugin, but what is not very clear to me is:
what is the difference between a plugin and a dll? what should i expect to find in an sdk to make it usable in my unity project?
Thanks a lot
To expand on #Everts comment instead of just copying it into an answer, I'll go a little into details here
What is a plugin?
It's a somewhat vague word for a third-party library that is somehow integrated with the rest of your game. It means that it neither is officialy supported by Unity, nor is it a part of your core code. It can be "plugged" in or out without altering its internals, so it must provide some kind of API that can be used by the game code.
For example, you'll find many plugins that handle external services like ads, notifications, analytics etc. You'll also find a couple of developer-tools that can also be called plugins, like tile-based map editors and such.
Plugins come in many forms - DLL files are one example but some plugins actually provide full source code for easier use. And of course, other plugins will provide native code for different platforms, like Objective-C for iOS or .jars for Android.
So to answer your first question:
DLL is simply a pre-compiled source file that can be a part of a plugin
A plugin is a whole library that can consist of multiple files with different formats (.cs, .dll, .jar, .m etc)
What do you need to use an sdk?
First of all - documentation. Like I said before, and like you noticed yourself, not all plugins give you access to the source code. And unfortunately, not many sdks have extensive and developer-friendly documentations so it can be a tough task to actually understand how to use a given sdk.
Secondly - the code. Many sdks give you some kind of "drag & drop" library, a single folder with all the neccessary files inside that you simply add to your Unity projects. I've also seen sdks that use Unity packages that you have to import via Assets > Import Package > Custom Package.
Once you have the code and documentation it's time to integrate it with your game. I strongly recommend using an abstract lyer in your game as, in my experience, you often have to change sdks for various reasons and you don't want to rewrite your game logic every time. So I suggest encapsulating sdk-related code in a single class so that you have to change only one class in your code when switching from, say, one ad provider to another (and keep the old class in case you need to switch back).
So you basically need three things:
Documentation (either a readme file or an online documentation)
The code (precompiled or source)
A versatile integration

AndroidAnnotations minimum API supported

I would like to know the minimum Android API level AndroidAnnoatations supports ? I could not find any info on their website .
regards,
Felix T
I think there is NO specific minimum Android API Level that AndroidAnnotations can work with.
Since it's a compilation tool, I mean it's related with the Java files and it's related not with Android API.
If you build an Android project with AndroidAnnotations, then some intermediate java files will be generated, which will be the final java file for Java compiler, and that's all. It's just used for convinience of your development. The generated apk file will not have information about AndroidAnnotations - it's something like a conversion tool (shorter exprssion to long complicated expression, which is not visible to you).
I think that you can use AndroidAnnotation from Android API Level 1.
Maybe some of the annotations cannot be used in Android API 1 project, but even if such case happens, just removing only that specific annotation in your .java file will make it work.

How to use the new Code Manager in the new Omniture Interface

I am confused within the new Omniture Interface for a small thing. I am trying to Generate SiteCatalyst JavaScript Code for my site.
Here is what I did.
Created Report Suites from Report Suite Manager.
and got confused how to generate code for my site.
See the old interface made it very clear to create code for my site by selecting a Report Suite as explained here.
But how to generate code by selecting a Report Suite in the new interface?
Thanks.
I don't know where the code generation is or if it even exists any longer. Have you considered using the tag manager?
It's in the Admin home under "Tag Management". You can download the site snippet from there. You will see all the code in your container at that point. You have to set variables a little differently when you use the tag manager at that point but there is plenty of documentation around it.
Code Manager
Code manager lets you download data collection code for web and mobile platforms.
Admin tools > Code Manager.
After you download the library, you must configure the code to send data to the correct tracking server and report suite.
Tag Manager
TagManager is the standard method for deployment of Adobe Marketing Cloud tags.Tag Manager 2.0 is the latest one available.
TagManager lets you:
Deploy Marketing Cloud products and Genesis integrations though a single hosted JavaScript file.
Manage tags and configuration in a secure administrative interface.
Test changes and quickly roll back to previous versions.
Use existing SiteCatalyst tags to implement TagManager without a complex deployment process.
Deploy third-party tags.
Dynamic Tag Manager
Adobe acquire Satellite and it is now DTM.It is the future of implementation.
Visit the link DTM
The old Code Manager is still there, just a bit hidden. If you go into the interface for Code Manager, just under that table is this text. It brings you to the old Code Manager:
To view the legacy code manager or download AppMeasurement libraries for BlackBerry, Windows Phone 7, or Symbian click here.
In future the world is expected to go with Tag Management and when you have time it is recommended that you implement that.
Thanks C.

BlackBerry java UI development

Is there a tool for BlackBerry java application UI development. I do not find drag and drop options in xml file in eclipse like in Android SDK. Is there something like Droid Draw here too? I am new to BB Java dev, any pointers are appreciated.
Unfortunately no... There is no designer tool for blackberry ui, it must all be done in code. I heard that RIM plans on coming out with something of the kind but there is no such tool available at the moment.
There are tutorials on how to create many of the common UI, if you are searching for something specific I'm sure you can find some sample code to get you started.

Blackberry JDE ArrayList?

The Blackberry JDE does not include java.util.ArrayList, even though it knows about java.util? What's up with that? Is there an equivalent class for BB? I don't want to use an array, really, because I have an unknown number of objects I'm dealing with. why does the Blackberry JDE leave so much out?
Well they are Java from a language standpoint. It just doesn't support all of the standard edition packages. It falls more inline with the microedition standards, but is way beyond J2ME from a package standpoint. They don't go around saying they're in compliance with J2SE 1.6, but it's still Java.
And of course it has arrays, unless you mean the class, Arrays. But, they have that too. It's located in package net.rim.device.api.util.
Yeah, Blackberry isn't J2SE, but it's not J2ME neither.
Check out:
IntVector
SimpleSortingIntVector
IntStack
ByteVector
UnsortedReadableList
SortedReadableList
I have doubts about impossibility of doing with those classes something you can do with ArrayList.
Great article: BlackBerry API Hidden Gems (Part Two)
You can add it into your package yourself. Get the ArrayList implementation and just add it into your project. You will also need to get the implementation for AbstractCollection, AbstractList, Collection, Comparable, ConcurrentModificationException, Iterator, List and ListIterator.
I have a project that has a java.util package and I have put all of these classes in there and I can now use ArrayList :). You will have to modify the classes slightly to use rim imports rather than standard java imports where necessary, but it can be done if you really want ArrayLists.

Resources