This is where Errai-Cordova comes in. As you can get from the name it uses Cordova to create an application that can be installed easily on mobile devices. Cordova is like a little web server and a web browser bundled into a mobile app. So now, when your application gets installed, the user will already have all of your front-end. To be able to use your backend you'll have to do some configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<module rename-to="Sample"> | |
<inherits name="org.jboss.errai.ui.Cordova"/> | |
<replace-with class="org.jboss.errai.example.client.local.Config"> | |
<when-type-is class="org.jboss.errai.bus.client.framework.Configuration"/> | |
</replace-with> | |
... |
org.jboss.errai.example.client.local.Config
you need to specify the address of your backend server like so:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jboss.errai.example.client.local; | |
import org.jboss.errai.bus.client.framework.Configuration; | |
public class Config implements Configuration { | |
@Override | |
public String getRemoteLocation() { | |
return "http://my-app-location.rhcloud.com/"; | |
} | |
} |
Now you can create some responsive html and have it behave nicely on differently sized devices. I'm not that good in designing something that looks very nice, but there are some really nice things that you can make. Take a look at 2012.inspireconf.com and make your browser window smaller to simulate looking at this site with a phone or a tablet.
Finally using the capabilities of the phone, like the camera or accelerometer, you can inject them in a true errai fashion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.googlecode.gwtphonegap.client.camera.Camera; | |
public class KitchenSinkClient extends Composite { | |
@Inject | |
Camera camera; | |
void onTakePictureClick() { | |
PictureOptions options = new PictureOptions(25); | |
options.setDestinationType(PictureOptions.DESTINATION_TYPE_DATA_URL); | |
options.setSourceType(PictureOptions.PICTURE_SOURCE_TYPE_CAMERA); | |
camera.getPicture(options, new PictureCallback() { | |
@Override | |
public void onSuccess(String data) { | |
image.setUrl(UriUtils.fromSafeConstant("data:image/jpeg;base64," + data)); | |
} | |
@Override | |
public void onFailure(String error) { | |
setGeneralErrorMessage("Could not take member picture: " + error); | |
} | |
}); | |
} |
Take a look at the demo project on github for a working example.
This is the sneak peak of what's to come, hope you like it!
Mobile applications are more popular and to making mobile application according to customer is challenging job.
ReplyDeletebest spy mobiles apps
Thank for sharing
ReplyDeleteCheaters Girls
gps spy app
Nowadays there are numerous essay writing services. Among all them I'd like to mention U Write My Essay because it's the most reliable and easy to use.
ReplyDeleteI'm very happy being Herpes free now. It was a sad incident that was announced to me after the check up in the hospital and I was diagnosed of HSV 2. I thank God now for using Dr.odey Abang to cure my virus. I'm not ashamed to say this because no virus of such can be detected in me. I'm Charlotte from Columbia. I thought about it many Times when I heard about this Herbal cures for Herpes. I was really happy when I came across blogs of comments of Doctors who run cures sicknesses and was comfortable to try Dr. Abang from patients testimony I came across here on my online page. I knew now they are real Africa herbalists who run cures for Herpes. There's every opportunity to be cure with natural herbs, because all medical prescriptions are derived from herbs and roots. Its really hard time living with Herpes on drugs which can't get you cure. I tried this and I can boost of myself now as a woman. I need to be loved not to lost, get your instant cure to all sicknesses from Dr, Odey Abang.
ReplyDeleteHe cures HSV,HPV,Cancer,low spam count and much more from the evidence I saw 💯 % sure no site effects with active immune booster
Email him for you cure
Odeyabangherbalhome@gmail.com
WhatsApp/calls
+2349015049094