I am developing an application where I have to use my some class in Today- Widget-Extension. But I am not getting any way to access those class.
Is it possible to access application class in Today- Widget-Extension.
It is possible. First you need to set targets of your class to both aplication and extension. Second you need to put public keyword to your class. You can read more on that here.
Related
I am trying to implement an OpenTok application using codename one. I already started with android and had pretty much everything working. I use a native interface to import the OpenTok library.
Now I am trying to implement the ios side. I have a class acting like the view controller :
#interface be_lsit_opentok_iosTestHelper <OTSessionDelegate, OTPublisherDelegate> : NSObject
This class implements all the needed methods for the session connection : https://tokbox.com/developer/tutorials/ios/basic-video-chat/ (step 4).
My class implementing the native interface handles the initialization of the session with the api_key... and then calls the session's "connectWithToken".
Once this is done I can notice using the OpenTok Playground that the connection works but I do also notice that opentok does not send a message to call the method "sessionDidConnect" which is a problem.
I do not understand why the call is not done and what sould I do?
I also tryed to call the method myself using a thread call the method only when the connection to the session is made and that its status is "OTSessionConnectionStatusConnected" and this worked.
I'm guessing here since I didn't do this. You implemented the viewDidLoad in your own code instead of the Codename One view did load.
You can inject code into the Codename One viewDidLoad method using the build hint ios.viewDidLoad. So a build hint like:
ios.viewDidLoad=[self connectToAnOpenTokSession];
Should work but you would also need to add an import for the API into our code. Unfortunately I couldn't find a suitable build hint to define that so I added one ios.viewDidLoadInclude which I will add tomorrow to the build will allow you to define an import or include statement required by the statement above.
Swift Access Control have three type Public,Internal,Private
I can create a project to test if i use Internal or Private
Private can only use in same source file
Internal can only use in same module(or same project)
but how can i test Public?
I don't know how to create two different module to test "Public"
Swift Access Control
I have a web application with three layers: Web > Services > Core. I've just added a Services.Tests unit tests project and I'm trying to figure out how to get started.
I've added a reference from the Services.Tests project to the Services project. I then created an instance of the Services.service class in my Test class:
[TestClass]
public class CrudTests
{
private readonly SetServices _setService = new SetServices();
[TestMethod]
public void TestMethod()
{
But I got an error about _setService needing a reference to my Core project.
First question: Why do I need to reference my core project if the Services project already references it?
I've added the reference and ran the empty test, which passed. I then tried to call one of the basic methods within my service class:
[TestMethod]
public void TestMethod()
{
_setService.CreateSet("Test Set", "Test Set Details", null);
But I get a providerIncompatileException.
Second question: What is the recommended way to create/use a dedicated test database?
Third question: How do I tell my tests project which database to use?
By parts,
Why do I need to reference my core project if the Services project already references it?
Project references aren't inheritable, as per this answer. The fact that Services has a dependency on Core does not imply that whoever consumes Services needs to know anything about Core, or for that matter uses any logic exclusively defined in Core.
What is the recommended way to create/use a dedicated test database?
It depends entirely on what database, what ORM, what framework, etc. There aren't fixed ways to do it.
How do I tell my tests project which database to use?
In the same way you tell the application to do it: through the configuration. Simply create a DatabaseStub and hard-code the test database information in it.
I am working with the Grails Authentication plugin and trying to add a domain class from the plugin into my GORM. I am able to use plugin objects in my application when importing them with, "import com.grailsrocks.authentication.AuthenticationUser", but getting "unable to resolve class" exception when trying to access my application objects from the plugin (I am trying to use the domain class "User" and my import command is "import blap.User" - package name is blap). Both import commands work from the shell, and the import statement is not triggering an error in STS.
I am new to grails, so I'm probably doing something very wrong. But, at this point I am running out of ideas, so any help would be greatly appreciated. Thanks!
Vitaly
While I haven't used the Grails Authentication plugin before, I don't think you should be modifying the plugin classes. In general, you should extend the plugin class you want to modify in your application and use your application class instead.
Actually, from reading the docs, it looks like you should use the event handling to modify the plugin behavior.
From the plugin docs:
The default AuthenticationUser domain class is minimal. If you want to change constraints or add fields (you may consider using a separate class instead for extra user data) you just redefine the onNewUserObject event and return your own instance of a domain class or similar wrapper around another authentication database such as LDAP
We have object inheritance in our java classes and in the operations we are returning the base classes. Upon running Java2WSDL we noticed that only the base class object is created in the WSDL and the derived classes are completely ignored. There was no straight-forward way to handle this so we used the "extra classes" option in Java2WSDL and got the classes going. So now the WSDL looks complete.
When the client uses the WSDL (generated above) it is able to get the derived classes but when it passes them the service the service doesn't instantiate the corresponding derived class but instance always instantiates the base class, though the soap message contains the reference to the derived class. What I notice from here is it looks like the service is missing those bindings.
How do I fix this problem? Any help would be greatly appreciated.
I am obviously not a Pro with Axis, but what you try to achieve looks quite like this item in the docs:
http://axis.apache.org/axis2/java/core/docs/adb/adb-advanced.html#typeSupport
Also, you should state what serialization framework you use for your question to be complete.