Flicking background image using Phonegap with Android - android

I've got an application that uses PhoneGap and it has a brackground image. My issue is that, even though I'm using the source, the image flicks a little bit. (It seems that Android and PhoneGap are taking different references of the screen to display the image).
This is the code:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
getWindow().setBackgroundDrawableResource(R.drawable.splash);
this.setIntegerProperty("splashscreen", R.drawable.splash);
super.setIntegerProperty("backgroundColor", Color.TRANSPARENT );
cna = new CustomNativeAccess(this, appView);
appView.getSettings().setAppCacheEnabled(true);
appView.getSettings().setRenderPriority(android.webkit.WebSettings.RenderPriority.HIGH);
appView.getSettings().setCacheMode(android.webkit.WebSettings.LOAD_DEFAULT );
appView.setBackgroundColor(0);
appView.setBackgroundResource(R.drawable.splash );
appView.clearCache(false);
super.loadUrl(url); // this is an external url so it takes a bit of time
}
as a temporary fix I have force the app to work in full screen, and in that way doesn't do the flicking as both (Android and PhoneGap) take as reference top 0,0.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN |
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
I'm using PhoneGap 1.6 and any help would be really appreciated.

Related

How to show the Unreal screen in Android's subview?

I want to know how to show the Unreal screen on Android's subview.
I apologize for my lack of English skills.
I want to show the Unreal screen in subView for Android-based projects.
I want to put it in a project created by a new project through Android Studio.
The start consists of Android native code, and several menus were all created using JetPack api.
Here, I want to configure the bottom with Android UI and the top with an Unreal screen.
Or, if you press the start button for UNREAL screen, I want to render the screen where the entire screen is UNREAL screen.
These two things should possible.
I knew how to do Unity.
Unity knows what is possible.
Is Unreal possible?
If possible, can I get help with the guide links such as documents and videos?
Try this as I assume that you have already added the Unreal Engine Viewport Client plugin to your project and that you have added a LinearLayout with the id
import com.epicgames.ue4.ViewportClient;
public class MainActivity extends Activity {
private ViewportClient mViewportClient;
private SurfaceView mSurfaceView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create the Android View to display the Unreal Engine Viewport
mSurfaceView = new SurfaceView(this);
// Add the Android View to the layout
LinearLayout layout = findViewById(R.id.layout);
layout.addView(mSurfaceView);
// Create the Viewport Client and associate it with the Android View
mViewportClient = new ViewportClient();
mViewportClient.SetViewport(mSurfaceView);
// Configure the rendering settings for the Viewport Client
mViewportClient.SetResolution(1920, 1080);
mViewportClient.SetCameraPosition(0, 0, 1000);
mViewportClient.SetPostProcessingEnabled(false);
// Start the rendering loop for the Viewport Client
mViewportClient.Start();
}
#Override
protected void onDestroy() {
super.onDestroy();
// Stop the rendering loop when the activity is destroyed
mViewportClient.Stop();
}
}

Asus Memo Pad 10 (ME102A) - It is posible to hide navbar with Android Jelly Bean 4.2.2?

I'm developing an app that needs to be fullscreen. I've tried some coding without any success which makes me wonder if it could be possible. If there is a way, how could I achieve this? If there is not, what could you suggest?
Thanks.
It depends on your target API. With 4.4 or later you might start with
https://developer.android.com/training/system-ui/immersive.html.
Otherwise try:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
...

Eclipse Android App Zoom In Code WebView

I'm very new to developing android apps. I've edited this app I found, which was open source and have got it working to a good extent. There's some code that isn't being used at all (Like the preferences menu) but I haven't removed that as I simply don't want to mess it up. Anyway, when I view the website it's zoomed in.. I've researched the problem and found a few ways to fix it, but none have worked. The app files can be downloaded at this link: http://www.megafileupload.com/en/file/504860/App-zip.html
Thanks for any help!
Now, here's where the answer comes in.
You get the settings for your webview before you instantiate it. You need something like:
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard); // do this first
WebView webView = (WebView) findViewById(R.id.yourwebviewid); // either this or
either the above to tie the Java object to an xml object
or create a view and add it to some parent
View parent = (View)findViewById(R.id.yourparent_layout_for_webview); // this
WebView webView = new WebView();
parent.add(webView);
webView.getSettings().setBuiltInZoomControls(true);

How to show fusion charts in android 2.3.3 devices

I am developing an application which requires fusion chart integration with android. Fusion chart is working absolutely fine with API level 3 above but it is not working on 2.3.3 devices.
Screen blinking is there then nothing happens. Please provide a solution for my problem.
If anyone have any sought of sample code then please share it. It will be a great help.
Edited:
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView mWeb = (WebView) findViewById(R.id.webView1);
mWeb.getSettings().setJavaScriptEnabled(true);
mWeb.getSettings().setPluginsEnabled(true);
mWeb.loadDataWithBaseURL("", getHTML(), "text/html", "UTF-8", "");
}
private String getHTML() {
String html = "<html><head><script language=\"JavaScript\"src=\"file:///android_asset/FusionCharts.js\"></script></head><body bgcolor=\"#ffffff\"><div id=\"chartdiv\" align=\"center\">The chart will appear within this DIV. This text will be replaced by the chart.</div><script type=\"text/javascript\">FusionCharts.setCurrentRenderer(\"javascript\");var myChart = new FusionCharts(\"file:///android_asset/Column3D.swf\", \"myChartId\", \"400\",\"400\");myChart.setXMLData(\"<graph caption='Title' decimalPrecision='0' formatNumberScale='0' showNames='1' xAxisName='XData' yAxisName='YData' ><set name='One' value='120' color='456553' /><set name='Two' value='345' color='234567' /><set name='Three' value='565' color='098765' /></graph>\");myChart.render(\"chartdiv\");</script></body></html>";
return html;
}
}
It seems the fusion charts are not supported below the Android v. 3.x, as mentioned by one of their staff in this forum on fusioncharts.com.
You may refer to some other chart engines or try this example for implementing chart without using any external jar file. Or you may refer these replies for similar chart engines here and here.
I personally have used AchartEngine and you may refer to this tutorial on how to implement it.

In phone gap html page take too much time to load

Hi I am making application using phone gap in which certain html pages in asset folder of project. and I am using the code below. but it takes too much time in loading.
can any one give proper solution ?
Thanks!
public class JvdActivity extends DroidGap {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
KeyBoard keyboard = new KeyBoard(this, appView);
appView.addJavascriptInterface(keyboard, "KeyBoard");
super.loadUrl("file:///android_asset/www/index.html");
}
}
If their are lots Images inside the HTML page then to load that page Inside the screen It takes Time.
But if it is requirement of your project then you will use progress bar saying Loading.. so that user can wait till the page gets loaded.

Categories

Resources