Search Results

Search found 11465 results on 459 pages for 'android ndk'.

Page 10/459 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to add a Fragment inside a ViewPager using Nested Fragment (Android 4.2)

    - by sabadow
    I have a ViewPager with three Fragments, each one shows a List (or Grid). In the new Android API level 17 (Jelly Bean 4.2), one of the features is Nested Fragments. The new functionality description says: if you use ViewPager to create fragments that swipe left and right and consume a majority of the screen space, you can now insert fragments into each fragment page. So, if I understand right, now I can create a ViewPager with Fragments (with a button inside for example) inside, and when user press the button show another Fragment without loose the ViewPager using this new feature. I expend my morning trying to implement this on several ways but I can´t made it... Can somebody show a simple example of how to do this? PS: I'm only interested in doing at this way, with getChildFragmentManager to learn how works.

    Read the article

  • Android camera AVD error 100

    - by Cristian Voina
    I am trying to learn how to make a simple app in android. As background information I have only programmed in C language, no OOP. Currently I am trying turn on the camera using the indications from Android Developer site but some minor changes: - no button for capturing image. - no new activity. What I am trying to do is jut preview the camera. I will post the Code that I am using, the manifest and the LogCat. Main Activity: package com.example.camera_display; import android.app.Activity; import android.hardware.Camera; import android.os.Bundle; import android.view.Menu; import android.widget.FrameLayout; import android.widget.TextView; public class MainActivity extends Activity { private Camera mcamera; private CameraPreview mCameraPreview; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mcamera = getCameraInstance(); mCameraPreview = new CameraPreview(this, mcamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview); preview.addView(mCameraPreview); } public static Camera getCameraInstance(){ Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e){ // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } CameraPreview Class: package com.example.camera_display; import java.io.IOException; import android.content.Context; import android.hardware.Camera; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; /** A basic Camera preview class */ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private static final String TAG = "MyActivity"; private SurfaceHolder mHolder; private Camera mCamera; public CameraPreview(Context context, Camera camera) { super(context); mCamera = camera; // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); // deprecated setting, but required on Android versions prior to 3.0 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // The Surface has been created, now tell the camera where to draw the preview. try { mCamera.setPreviewDisplay(holder); mCamera.startPreview(); } catch (IOException e) { Log.d(TAG, "Error setting camera preview: " + e.getMessage()); } } public void surfaceDestroyed(SurfaceHolder holder) { // empty. Take care of releasing the Camera preview in your activity. } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // If your preview can change or rotate, take care of those events here. // Make sure to stop the preview before resizing or reformatting it. if (mHolder.getSurface() == null){ // preview surface does not exist return; } // stop preview before making changes try { mCamera.stopPreview(); } catch (Exception e){ // ignore: tried to stop a non-existent preview } // set preview size and make any resize, rotate or // reformatting changes here // start preview with new settings try { mCamera.setPreviewDisplay(mHolder); mCamera.startPreview(); } catch (Exception e){ Log.d(TAG, "Error starting camera preview: " + e.getMessage()); } } } Manifest: <uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera"/> LOG CAT: 06-30 15:58:35.075: D/libEGL(1153): loaded /system/lib/egl/libEGL_emulation.so 06-30 15:58:35.147: D/(1153): HostConnection::get() New Host Connection established 0x2a156060, tid 1153 06-30 15:58:35.478: D/libEGL(1153): loaded /system/lib/egl/libGLESv1_CM_emulation.so 06-30 15:58:35.515: D/libEGL(1153): loaded /system/lib/egl/libGLESv2_emulation.so 06-30 15:58:36.334: W/EGL_emulation(1153): eglSurfaceAttrib not implemented 06-30 15:58:36.685: D/OpenGLRenderer(1153): Enabling debug mode 0 06-30 15:58:36.935: D/MyActivity(1153): Error starting camera preview: startPreview failed 06-30 15:58:36.965: I/Choreographer(1153): Skipped 125 frames! The application may be doing too much work on its main thread. 06-30 15:58:38.455: W/Camera(1153): Camera server died! 06-30 15:58:38.455: W/Camera(1153): ICamera died 06-30 15:58:38.476: E/Camera(1153): Error 100 So If anyone could tell me what I am doing wrong (and explain why it should be done different) that would be great :) Thanks!

    Read the article

  • How to programatically set drawableLeft on Android button?

    - by Frank LoVecchio
    I'm dynamically creating buttons. I styled them using XML first, and I'm trying to take the XML below and make it programattic. <Button android:id="@+id/buttonIdDoesntMatter" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="buttonName" android:drawableLeft="@drawable/imageWillChange" android:onClick="listener" android:layout_width="fill_parent"> </Button> This is what I have so far. I can do everything but the drawable. linear = (LinearLayout) findViewById(R.id.LinearView); Button button = new Button(this); button.setText("Button"); button.setOnClickListener(listener); button.setLayoutParams( new LayoutParams( android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT ) ); linear.addView(button);

    Read the article

  • android soft keyboard covers editText in landscape

    - by gabi
    I have the following layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical" android:layout_above="@+id/edittext"> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="line1"/> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="line2"/> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="line3"/> </LinearLayout> <EditText android:id="@id/edittext" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_margin="5dp" android:text="test" android:layout_alignParentBottom="true" android:imeOptions="flagNoExtractUi" /> </RelativeLayout> and in landscape on a Nexus one it looks like: Is there a way to fix this, but keep flag flagNoExtractUi ?

    Read the article

  • Android Emulator - Cannot get keyboard to display

    - by Ash
    Basically I cannot get the onscreen keyboard to display at all. I've tried every solution I've read to make it appear within my application, and now I've come to the conclusion that it must be the emulator as it isn't appearing when using Messages, writing e-mails etc. I've looked in Language & input within settings and checked Sample Soft Keyboard, rebooted the emulator with no change. Using Android SKD 2.3.3 3.7in WVGA (Nexus One) I'm hoping someone can maybe guess what's going on. Many thanks

    Read the article

  • layout problam in android

    - by mahdi
    Hi i try show layout like image 1 (textView and editText in same line) but my out put shown like image 2 ! i try with this code : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" > <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="URL:" android:layout_alignBaseline="@+id/entry" android:layout_alignParentLeft="true"/> /> <EditText android:id="@+id/entry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/label" android:layout_alignParentTop="true" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:paddingRight="30px" android:paddingLeft="30px" android:text="Go..." /> </LinearLayout> please help me thanks

    Read the article

  • Problem Building dschaefer / android-box2d

    - by Qwark
    I'm trying to build dschaefer android-box2d, and did follow the recipe. I do get this error when trying to build the TestBox2d with eclipse: make all /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld \ -nostdlib -shared -Bsymbolic --no-undefined \ -o obj/libtest.so obj/test.o -L../box2d/lib/android -lbox2d \ -L/cygdrive/c/android/android-ndk-r3/build/platforms/android-3/arch-arm/usr/lib \ -llog -lc -lstdc++ -lm \ /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a \ /cygdrive/c/android/android-ndk-r3/build/prebuilt/windows/arm-eabi-4.2.1/bin/arm-eabi-ld: cannot find -lbox2d make: * [obj/libtest.so] Error 1 The only thing I did change was in the TestBox2d\Makefile where i did change the path to the NDK. There are some other that have the same problem HERE but I do not know how to fix it.

    Read the article

  • Android widget text under image

    - by Chandana
    Hi All, I have create android widget, But I need to display application name under the widget name. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/starticon" android:layout_width="wrap_content" android:visibility="visible" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:padding="5dip" android:src="@drawable/light_bulb_accept" /> <ImageView android:id="@+id/stopicon" android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:padding="5dip" android:src="@drawable/light_bulb_delete" /> <TextView android:layout_below="@+id/starticon" android:layout_width="wrap_content" android:visibility="visible" android:layout_height="wrap_content" android:text="@string/app_name" /> </LinearLayout> I have programmatically hide the Image ICON, Bu thing is Text View didn't diaplay undet the image. Is any one know, why this Text does not display under Image? Thank You.

    Read the article

  • Problem building STLport NDK r5/ Android

    - by user558299
    Hi all, I'm trying to build STLport for Android. I got the following steps, but they are not working: 1 - Clone STLport repository using: git clone git://stlport.git.sourceforge.net/gitroot/stlport/stlport 2 - Configure environment using : ./configure --target=arm-eabi --with-extra-cxxflags="-fshort-enums" --with-extra-cflags="-fshort-enums" 3 - From src directory build it using make SYSROOT"{MY NDK path}/platforms/android-5/arch-arm/" release-static But I got the following errors: In file included from ../stlport/stl/_alloc.h:45, from ../stlport/memory:29, from dll_main.cpp:41: ../stlport/stl/_new.h:45:24: error: new: No such file or directory In file included from ../stlport/stl/_limits.h:36, from ../stlport/limits:29, from dll_main.cpp:48: ../stlport/stl/_cwchar.h:26:30: error: cstddef: No such file or directory In file included from ../stlport/stl/_utility.h:35, from ../stlport/utility:35, from dll_main.cpp:40: ../stlport/type_traits:889: error: 'declval' was not declared in this scope ../stlport/type_traits:889: error: expected primary-expression before '>' token ../stlport/type_traits:889: error: expected primary-expression before ')' token ../stlport/type_traits:889: error: 'declval' was not declared in this scope ../stlport/type_traits:889: error: expected primary-expression before '>' token ../stlport/type_traits:889: error: expected primary-expression before ')' token ../stlport/type_traits:889: error: ISO C++ forbids declaration of 'decltype' with no type ../stlport/type_traits:889: error: ISO C++ forbids in-class initialization of non-const static member 'decltype' ../stlport/type_traits:889: error: template declaration of 'int std::tr1::detail::decltype' ../stlport/type_traits:942: error: ISO C++ forbids declaration of 'decltype' with no type ../stlport/type_traits:942: error: ISO C++ forbids in-class initialization of non-const static member 'decltype' ../stlport/type_traits:942: error: template declaration of 'int std::tr1::detail::decltype' make: *** [obj/arm-eabi-gcc/so/dll_main.o] Error 1 Is there any include dir or configuration I´m missing? Thanks, Sergio

    Read the article

  • Help regarding Android NDK

    - by Siva Kumar
    I am a beginner in using Android NDK. I am using Eclipse and I installed cygwin to build the c file to generate the .so file But while building the c file in cygwin I am always getting the error make: ***No rule to make target 'file.c' ... .Stop I tried building different C codes but for every file it says the same error .. Here is the source code: public class ndktest extends Activity { static { System.loadLibrary("ndkt"); } private native void helloLog(String logThis); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); helloLog("this is to test log file"); } } file.c void Java_com_ndktest_helloLog(JNIEnv * env, jobject this, jstring logThis) { jboolean isCopy; const char * szLogThis = (*env)->GetStringUTFChars(env, logThis, &isCopy); (*env)->ReleaseStringUTFChars(env, logThis, szLogThis); } And here is my Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_LDLIBS := -llog LOCAL_MODULE := ndkt LOCAL_SRC_FILES := file.c include $(BUILD_SHARED_LIBRARY) I searched for the solution for the cause of error ... but nothing works for me. Can anyone tell me where I am making the mistake ? Thanks, Siva Kumar

    Read the article

  • Porting Symbian C++ to Android NDK

    - by Donal Rafferty
    I've been given some Symbian C++ code to port over for use with the Android NDK. The code has lots of Symbian specific code in it and I have very little experience of C++ so its not going very well. The main thing that is slowing me down is trying to figure out the alternatives to use in normal C++ for the Symbian specific code. At the minute the compiler is throwing out all sorts of errors for unrecognised types. From my recent research these are the types that I believe are Symbian specific: TInt, TBool, TDesc8, RSocket, TInetAddress, TBuf, HBufc, RPointerArray Changing TInt and TBool to int and bool respectively works in the compiler but I am unsure what to use for the other types? Can anyone help me out with them? Especially TDesc, TBuf, HBuf. Also Symbian has a two phase contructor using NewL and NewLc But would changing this to a normal C++ constructor be ok? Finally Symbian uses the clean up stack to help eliminate memory leaks I believe, would removing the clean up stack code be acceptable, I presume it should be replaced with try/catch statements?

    Read the article

  • Android: HTTPClient

    - by primal
    Hi, I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console. [2010-04-30 09:26:36 - HalloAndroid] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.org.example/.HalloAndroid } from null (pid=-1, uid=-1) requires android.permission.INTERNET I have added android.permission.INTERNET in AndroidManifest.xml. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.org.example" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HalloAndroid" android:label="@string/app_name" android:permission="android.permission.INTERNET"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest> The java code in HalloAndroid.java is as follows HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget2 = new HttpGet("http://google.com/"); HttpResponse response2 = null; try { response2 = httpclient.execute(httpget2); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response2.getEntity(); if (entity != null) { long len = entity.getContentLength(); if (len != -1 && len < 2048) { try { Log.d(TAG, EntityUtils.toString(entity)); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { // Stream content out } Any help is much appreciated.

    Read the article

  • Playing video from URL -Android

    - by Rajeev
    In the following code what ami doing wrong the video dosnt seem to play here.Is that the permission issue if so what should be included in the manifest file this main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:baselineAligned="true"> <LinearLayout android:layout_height="match_parent" android:layout_width="wrap_content" android:id="@+id/linearLayout2"></LinearLayout> <MediaController android:id="@+id/mediacnt" android:layout_width="wrap_content" android:layout_height="wrap_content"></MediaController> <LinearLayout android:layout_height="match_parent" android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:orientation="vertical"></LinearLayout> <Gallery android:layout_height="wrap_content" android:id="@+id/gallery" android:layout_width="wrap_content" android:layout_weight="1"></Gallery> <VideoView android:layout_height="match_parent" android:id="@+id/vv" android:layout_width="wrap_content"></VideoView> </LinearLayout> this is java class package com.gallery; import java.net.URL; import android.app.Activity; import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.widget.MediaController; import android.widget.Toast; import android.widget.VideoView; public class GalleryActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Toast.makeText(GalleryActivity.this, "Hello world", Toast.LENGTH_LONG).show(); VideoView videoView = (VideoView) findViewById(R.id.vv); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(videoView); // Set video link (mp4 format ) Uri video = Uri.parse("http://www.youtube.com/watch?v=lEbxLDuecHU&playnext=1&list=PL040F3034C69B1674"); videoView.setMediaController(mediaController); videoView.setVideoURI(video); videoView.start(); } }

    Read the article

  • Problem with sqlite database on android platform

    - by mudit
    hi all i am developing an application which uses sqlite db for storing records. I am developing this application on SDK 1.5.. when i test the application on 1.5 device it works good but when i try to run it on a 1.6 device i get a force close message with following logcat output: 03-19 09:31:35.206: ERROR/AndroidRuntime(224): Uncaught handler: thread main exiting due to uncaught exception 03-19 09:31:35.226: ERROR/AndroidRuntime(224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.android/com.abc.android.app}: android.database.sqlite.SQLiteException: unable to open database file 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.os.Handler.dispatchMessage(Handler.java:99) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.os.Looper.loop(Looper.java:123) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread.main(ActivityThread.java:4310) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at java.lang.reflect.Method.invokeNative(Native Method) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at java.lang.reflect.Method.invoke(Method.java:521) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at dalvik.system.NativeStart.main(Native Method) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): Caused by: android.database.sqlite.SQLiteException: unable to open database file 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1697) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at com.abc.android.DbAdapter.open(DbAdapter.java:101) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at com.abc.android.class1.onCreate(class1.java:105) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417) 03-19 09:31:35.226: ERROR/AndroidRuntime(224): ... 11 more DBAdapter.java public DbAdapter open() throws SQLException { Log.d("DbAdapter", "in DbAdapter open()"); mDbHelper = new DatabaseHelper(mCtx); mDb = mDbHelper.getWritableDatabase(); // line 101 return this; } DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_QUERY); } class1.java mDB = new DbAdapter(Class1.this); mDB.open(); // line 105 Please help..what do i do????

    Read the article

  • Bottom button bar overlaps the last element of Listview!!

    - by elto
    I have a listview which is part of an Activity. I want user to have a choice for batch deleting the items in the listview, so when he chooses the corresponding option from the menu, every list item gets a checkbox next to it. When user clicks any checkbox, a button bar is to slide up from bottom (as in gmail app) and clicking delete button deletes the selected items, however clicking cancel button on the bar would uncheck all the checked items. This is my page layout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" > <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:id="@+id/list_area" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" > <ListView android:id="@+id/mylist" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:drawSelectorOnTop="false" android:layout_weight="1" /> <TextView android:id="@+id/empty_list_message" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:layout_gravity="center_vertical|center_horizontal" android:text="@string/msg_for_emptyschd" android:layout_margin="14dip" android:layout_weight="1" /> </LinearLayout> <RelativeLayout android:id="@+id/bottom_action_bar" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/schedule_bottom_actionbar_border" android:layout_marginBottom="2dip" android:layout_gravity="bottom" android:visibility="gone" > <Button android:id="@+id/delete_selecteditems_button" android:text="Deleted Selected" android:layout_width="140dip" android:layout_height="40dip" android:layout_alignParentLeft="true" android:layout_marginLeft="3dip" android:layout_marginTop="3dip" /> <Button android:id="@+id/cancel_button" android:text="Cancel" android:layout_width="140dip" android:layout_height="40dip" android:layout_alignParentRight="true" android:layout_marginRight="3dip" android:layout_marginTop="3dip" /> </RelativeLayout> </FrameLayout> </LinearLayout> so far, I have got everything working except that when the bottom bar becomes visible upon checkbox selection, it overlaps the last element of the list. All other list items can be scrolled up, but you cant scroll up the very last item of the list, therefore user can not select that item if he intends to. Here is the screenshot of the overlap. I have tried using the listview footer option, but that appends the bar to the end of the list instead of keeping it fixed at the bottom of the screen. Is there a way I could "raise" the listview enough so that the overlap wont happen?? BTW, I have already tried adding the bottom-margin to the listview itself, or the LinearLayout wrapping the listview right before making the button-bar visible, but it introduces other bugs like clicking one checkbox checks some another checkbox in listview.

    Read the article

  • Reading Resource Files from my own APK in Android Native Environment

    - by Kyle
    I'm porting to Android. My existing project has a ton of resource files that I'm porting into my Android project. I have them all in /res/raw/, and I would like to access those resources in my native library with functions such as fopen() and such. Can this be done, or do I have to go through JNI for this as well? I would really prefer not to, for ease of porting and possible speed and memory reasons.

    Read the article

  • Is it possible to restart the phone with Android SDK or NDK?

    - by J Andy
    Is it possible to programmatically restart the phone from a application (service) running on top of the Dalvik VM? If the SDK does not provide this functionality, then how about using the NDK and calling some functions provided by the kernel? I know this option is not preferred (not stable enough libs), but if it's the only option, I'll have to consider that as well.

    Read the article

  • How to build Open JavaFX for Android.

    - by PictureCo
    Here's a short recipe for baking JavaFX for Android dalvik. We will need just a few ingredients but each one requires special care. So let's get down to the business.  SourcesThe first ingredient is an open JavaFX repository. This should be piece of cake. As always there's a catch. You probably know that dalvik is jdk6 compatible  and also that certain APIs are missing comparing to good old java vm from Oracle.  Fortunately there is a repository which is a backport of regular OpenJFX to jdk7 and going from jdk7 to jdk6 is possible. The first thing to do is to clone or download the repository from https://bitbucket.org/narya/jfx78. Main page of the project says "It works in some cases" so we will presume that it will work in most cases As I've said dalvik vm misses some APIs which would lead to a build failures. To get them use another compatibility repository which is available on GitHub https://github.com/robovm/robovm-jfx78-compat. Download the zip and unzip sources into jfx78/modules/base.We need also a javafx binary stubs. Use jfxrt.jar from jdk8.The last thing to download are freetype sources from http://freetype.org. These will be necessary for native font rendering. Toolchain setup I have to point out that these instructions were tested only on linux. I suppose they will work with minimal changes also on Mac OS. I also presume that you were able to build open JavaFX. That means all tools like ant, gradle, gcc and jdk8 have been installed and are working all right. In addition to this you will need to download and install jdk7, Android SDK and Android NDK for native code compilation.  Installing all of them will take some time. Don't forget to put them in your path. export ANDROID_SDK=/opt/android-sdk-linux export ANDROID_NDK=/opt/android-ndk-r9b export JAVA_HOME=/opt/jdk1.7.0 export PATH=$JAVA_HOME/bin:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK FreetypeUnzip freetype release sources first. We will have to cross compile them for arm. Firstly we will create a standalone toolchain for cross compiling installed in ~/work/ndk-standalone-19. $ANDROID_NDK/build/tools/make-standalone-toolchain.sh  --platform=android-19 --install-dir=~/work/ndk-standalone-19 After the standalone toolchain has been created cross compile freetype with following script: export TOOLCHAIN=~/work/freetype/ndk-standalone-19 export PATH=$TOOLCHAIN/bin:$PATH export FREETYPE=`pwd` ./configure --host=arm-linux-androideabi --prefix=$FREETYPE/install --without-png --without-zlib --enable-shared sed -i 's/\-version\-info \$(version_info)/-avoid-version/' builds/unix/unix-cc.mk make make install It will compile and install freetype library into $FREETYPE/install. We will link to this install dir later on. It would be possible also to link openjfx font support dynamically against skia library available on Android which already contains freetype. It creates smaller result but can have compatibility problems. Patching Download patches javafx-android-compat.patch + android-tools.patch and patch jfx78 repository. I recommend to have look at patches. First one android-compat.patch updates openjfx build script, removes dependency on SharedSecret classes and updates LensLogger to remove dependency on jdk specific PlatformLogger. Second one android-tools.patch creates helper script in android-tools. The script helps to setup javaFX Android projects. Building Now is time to try the build. Run following script: JAVA_HOME=/opt/jdk1.7.0 JDK_HOME=/opt/jdk1.7.0 ANDROID_SDK=/opt/android-sdk-linux ANDROID_NDK=/opt/android-ndk-r9b PATH=$JAVA_HOME/bin:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK:$PATH gradle -PDEBUG -PDALVIK_VM=true -PBINARY_STUB=~/work/binary_stub/linux/rt/lib/ext/jfxrt.jar \ -PFREETYPE_DIR=~/work/freetype/install -PCOMPILE_TARGETS=android If everything went all right the output is in build/android-sdk Create first JavaFX Android project Use gradle script int android-tools. The script sets the project structure for you.   Following command creates Android HelloWorld project which links to a freshly built javafx runtime and to a HelloWorld application. NAME is a name of Android project. DIR where to create our first project. PACKAGE is package name required by Android. It has nothing to do with a packaging of javafx application. JFX_SDK points to our recently built runtime. JFX_APP points to dist directory of javafx application. (where all application jars sit) JFX_MAIN is fully qualified name of a main class. gradle -PDEBUG -PDIR=/home/user/work -PNAME=HelloWorld -PPACKAGE=com.helloworld \ -PJFX_SDK=/home/user/work/jfx78/build/android-sdk -PJFX_APP=/home/user/NetBeansProjects/HelloWorld/dist \ -PJFX_MAIN=com.helloworld.HelloWorld createProject Now cd to the created project and use it like any other android project. ant clean, debug, uninstall, installd will work. I haven't tried it from any IDE Eclipse nor Netbeans. Special thanks to Stefan Fuchs and Daniel Zwolenski for the repositories used in this blog post.

    Read the article

  • Installing Lubuntu on to Android tablet and switching os in between

    - by user1702061
    I would like to install Lubuntu onto my tablet, as it seems more lightweight than ubuntu. However, it seems there are only images for Windows/ Mac? For Android devices, what image shall I download? I've also found an article about installing Ubuntu on Android phone. And by installing VNC, it seems that one could "switch" from OS to OS on the phone, i.e. I could be viewing the Ubuntu OS on the phone via a VNC viewer, and closing the viewer gives me back the Android OS. My questions are: 1) What ubuntu/lubuntu image (windows?mac?) shall I download in order to get this done? 2) My ultimate goal is to run some windows programs on a Android tablet. I am planning install a lubuntu os and then wine... what will be the minimum hardware requirement in order to do this? Thank you very much!

    Read the article

  • Android - passing data between Activities

    - by Bill Osuch
    (To follow along with this, you should understand the basics of starting new activities: Link ) The easiest way to pass data from one activity to another is to create your own custom bundle and pass it to your new class. First, create two new activities called Search and SearchResults (make sure you add the second one you create to the AndroidManifest.xml file!), and create xml layout files for each. Search's file should look like this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical">     <TextView          android:layout_width="fill_parent"      android:layout_height="wrap_content"      android:text="Name:"/>     <EditText                android:id="@+id/edittext"         android:layout_width="fill_parent"         android:layout_height="wrap_content"/>     <TextView          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="ID Number:"/>     <EditText                android:id="@+id/edittext2"                android:layout_width="fill_parent"                android:layout_height="wrap_content"/>     <Button           android:id="@+id/btnSearch"          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="Search" /> </LinearLayout> and SearchResult's should look like this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical">     <TextView          android:id="@+id/txtName"         android:layout_width="fill_parent"         android:layout_height="wrap_content"/>     <TextView          android:id="@+id/txtState"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="No data"/> </LinearLayout> Next, we'll override the OnCreate method of Search: @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.search);     Button search = (Button) findViewById(R.id.btnSearch);     search.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {                           Intent intent = new Intent(Search.this, SearchResults.class);              Bundle b = new Bundle();                           EditText txt1 = (EditText) findViewById(R.id.edittext);             EditText txt2 = (EditText) findViewById(R.id.edittext2);                                      b.putString("name", txt1.getText().toString());             b.putInt("state", Integer.parseInt(txt2.getText().toString()));                              //Add the set of extended data to the intent and start it             intent.putExtras(b);             startActivity(intent);          }     }); } This is very similar to the previous example, except here we're creating our own bundle, adding some key/value pairs to it, and adding it to the intent. Now, to retrieve the data, we just need to grab the Bundle that was passed to the new Activity and extract our values from it: @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.search_results);     Bundle b = getIntent().getExtras();     int value = b.getInt("state", 0);     String name = b.getString("name");             TextView vw1 = (TextView) findViewById(R.id.txtName);     TextView vw2 = (TextView) findViewById(R.id.txtState);             vw1.setText("Name: " + name);     vw2.setText("State: " + String.valueOf(value)); }

    Read the article

  • How do people deal with Android fragmentation?

    - by Bill
    I've spent the past few years working on iOS apps, and I'm now giving some serious consideration to creating an Android port of one of my apps. I'm sure that complaints about fragmentation are a frustrating cliche to experienced Android programmers, but as an iOS programmer, I'm quite honestly overwhelmed by the number of configurations and devices that my app might end up running on. There are literally thousands of Android devices in the wild, but I know there are successful Android developers in the world and I know they're not testing or developing for thousands of different devices. So how can a relatively small company deal with fragmentation? Is it possible to pick the five or six most popular devices, focus on those and prevent the app from being installed on any other devices? Are there any other strategies for practically dealing with the number of different configurations an app will face?

    Read the article

  • How to fix notifyDataSetChanged/ListView problems in dynamic Adapter wrapper Android

    - by ipaterson
    Summary: Trying to dynamically add heading rows to a ListView via a custom adapter wrapper. ListView is having trouble keeping the scroll position in sync. Runnable demo project provided. I would like to dynamically add items to a list based on the values in a CursorAdapter, several positions ahead of what the user is currently viewing. To do this, I have an adapter that wraps the CursorAdapter and keeps the new content indexed in a SparseArray. The ListView needs to be updated when items are added to the custom adapter, but I have met a lot of pitfalls trying to get that to work and would love some advice. The demo project can be downloaded here: http://dl.dropbox.com/u/15334423/DynamicSectionedList.zip In the demo, the headings are added dynamically by looking ahead 10 places to find the correct position where the list items switch to the next letter. Each implementation of notifyDataSetChanged has problems as described: Demo 1 This demo shows the importance of notifyDataSetChanged(). On clicking anything, the app will crash. This is due to some sanity checking in ListView... mItemCount != adapter.getItemCount(). Moral is, we need to notify the list that data has changed. Demo 2 The natural next step is to notify the ListView of changes when changes occur. Unfortunately, doing so while the ListView is scrolling firmly breaks all touch interaction until the app switches out of touch mode. You will need to "fling scroll" far enough to generate new headings in order to notice this. Tapping the screen will not cause the scroll to stop, and once stopped none of the list items will be clickable. This is due to some if (!mDataChanged) { /* do very important stuff */ } code in AbsListView.onTouchEvent(). Demo 3 To fix this, Demo 3 introduces a pendingChanges flag and the custom Adapter gains a notifyDataSetChangedIfNeeded() which can be called by the ListView once it has entered a "safe" state for changes. The first point where changes must be notified is in ListView.layoutChildren(), so I overrode that method to first notify of changes if needed, then call through. Fling past at least one heading then click a list item. This doesn't quite work right, though I'm not totally sure why. Tapping or selecting an item with the keyboard/trackball causes the list to refresh without properly syncing the old position. It scrolls to the top of the list which is not acceptable. Demo 4 The scroll problem in Demo 3 can be conquered, at least in touch mode. By adding a call to notifyDataSetChangedIfNeeded() on touch down, the data change happens to take place at such a time that all touch interaction works as expected and the list position is properly synced. However, I can't find an analog for that when the device is not in touch mode, not to mention the fact that it definitely seems like a hack. The list almost always scrolls back to the top, I can't find out what causes it to occasionally maintain the correct position. Since Android is fighting me at each step of the way, I feel like there should be a better approach. Please try the demo, if any fixes can be applied to get it working that would be great! Many thanks to anyone who can look into this, hopefully if we can get the code working it will be useful for others trying to accomplish the same optimization for lists with headings.

    Read the article

  • Android exception i don't understand after loading webpage in a webview

    - by DixieFlatline
    I have a webview that loads a webpage. I also have a reload button. Sometimes it works but sometimes it crashes when i hit reload and i get this exceptions: 05-14 10:08:33.958: ERROR/WindowManager(918): Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here 05-14 10:08:33.958: ERROR/WindowManager(918): android.view.WindowLeaked: Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewRoot.(ViewRoot.java:217) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.Window$LocalWindowManager.addView(Window.java:392) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Dialog.show(Dialog.java:231) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ProgressDialog.show(ProgressDialog.java:107) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ProgressDialog.show(ProgressDialog.java:90) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.poslji.gor.Odgovori$2.onClick(Odgovori.java:120) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.performClick(View.java:2179) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.onTouchEvent(View.java:3828) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.widget.TextView.onTouchEvent(TextView.java:6307) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.dispatchTouchEvent(View.java:3368) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Activity.dispatchTouchEvent(Activity.java:1997) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Activity.dispatchTouchEvent(Activity.java:1997) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewRoot.handleMessage(ViewRoot.java:1761) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.os.Handler.dispatchMessage(Handler.java:99) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.os.Looper.loop(Looper.java:123) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-14 10:08:33.958: ERROR/WindowManager(918): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 10:08:33.958: ERROR/WindowManager(918): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-14 10:08:33.958: ERROR/WindowManager(918): at dalvik.system.NativeStart.main(Native Method) 05-14 10:08:36.768: ERROR/AndroidRuntime(918): Uncaught handler: thread main exiting due to uncaught exception 05-14 10:08:36.778: ERROR/AndroidRuntime(918): java.lang.IllegalArgumentException: View not attached to window manager 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.Window$LocalWindowManager.removeView(Window.java:400) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.dismissDialog(Dialog.java:268) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.access$000(Dialog.java:69) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog$1.run(Dialog.java:103) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.dismiss(Dialog.java:252) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.poslji.gor.Odgovori$HelloWebViewClient.onPageFinished(Odgovori.java:180) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:225) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.os.Handler.dispatchMessage(Handler.java:99) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.os.Looper.loop(Looper.java:123) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at dalvik.system.NativeStart.main(Native Method) What is going wrong here?

    Read the article

  • Android WebView not loading a JavaScript file, but Android Browser loads it fine.

    - by Justin
    I'm writing an application which connects to a back office site. The backoffice site contains a whole slew of JavaScript functions, at least 100 times the average site. Unfortunately it does not load them, and causes much of the functionality to not work properly. So I am running a test. I put a page out on my server which loads the FireBugLite javascript text. Its a lot of javascript and perfect to test and see if the Android WebView will load it. The WebView loads nothing, but the browser loads the Firebug Icon. What on earth would make the difference, why can it run in the browser and not in my WebView? Any suggestions. More background information, in order to get the stinking backoffice application available on a Droid (or any other platform except windows) I needed to trick the bakcoffice application to believe what's accessing the website is Internet Explorer. I do this by modifying the WebView User Agent. Also for this application I've slimmed my landing page, so I could give you the source to offer me aid. package ksc.myKMB; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.graphics.Bitmap; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebSettings; import android.webkit.WebViewClient; import android.widget.Toast; public class myKMB extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** Performs base set up */ /** Create a Activity of this Activity, IE myProcess */ myProcess = this; /*** Create global objects and web browsing objects */ HideDialogOnce = true; webview = new WebView(this) { }; webChromeClient = new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% myProcess.setProgress((progress * 100)); //CreateMessage("Progress is : " + progress); } }; webViewClient = new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(myProcess, MessageBegText + description + MessageEndText, Toast.LENGTH_SHORT).show(); } public void onPageFinished (WebView view, String url) { /** Hide dialog */ try { // loadingDialog.dismiss(); } finally { } //myProcess.setProgress(1000); /** Fon't show the dialog while I'm performing fixes */ //HideDialogOnce = true; view.loadUrl("javascript:document.getElementById('JTRANS011').style.visibility='visible';"); } public void onPageStarted(WebView view, String url, Bitmap favicon) { if (HideDialogOnce == false) { //loadingDialog = ProgressDialog.show(myProcess, "", // "One moment, the page is laoding...", true); } else { //HideDialogOnce = true; } } }; getWindow().requestFeature(Window.FEATURE_PROGRESS); webview.setWebChromeClient(webChromeClient); webview.setWebViewClient(webViewClient); setContentView(webview); /** Load the Keynote Browser Settings */ LoadSettings(); webview.loadUrl(LandingPage); } /** Get Menu */ @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } /** an item gets pushed */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // We have only one menu option case R.id.quit: System.exit(0); break; case R.id.back: webview.goBack(); case R.id.refresh: webview.reload(); case R.id.info: //IncludeJavascript(""); } return true; } /** Begin Globals */ public WebView webview; public WebChromeClient webChromeClient; public WebViewClient webViewClient; public ProgressDialog loadingDialog; public Boolean HideDialogOnce; public Activity myProcess; public String OverideUserAgent_IE = "Mozilla/5.0 (Windows; MSIE 6.0; Android 1.6; en-US) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2 myKMB/1.0"; public String LandingPage = "http://kscserver.com/main-leap-slim.html"; public String MessageBegText = "Problem making a connection, Details: "; public String MessageEndText = " For Support Call: (xxx) xxx - xxxx."; public void LoadSettings() { webview.getSettings().setUserAgentString(OverideUserAgent_IE); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setBuiltInZoomControls(true); webview.getSettings().setSupportZoom(true); } /** Creates a message alert dialog */ public void CreateMessage(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(message) .setCancelable(true) .setNegativeButton("Close", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); } } My Application is running in the background, and as you can see no Firebug in the lower right hand corner. However the browser (the emulator on top) has the same page but shows the firebug. What am I doing wrong? I'm assuming its either not enough memory allocated to the application, process power allocation, or a physical memory thing. I can't tell, all I know is the results are strange. I get the same thing form my android device, the application shows no firebug but the browser shows the firebug.

    Read the article

  • stdexcept On Android

    - by David R.
    I'm trying to compile SoundTouch on Android. I started with this configure line: ./configure CPPFLAGS="-I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/" LDFLAGS="-Wl,-rpath-link=/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -L/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/lib -nostdlib -lc" --host=arm-eabi --enable-shared=yes CFLAGS="-nostdlib -O3 -mandroid" host_alias=arm-eabi --no-create --no-recursion Because the Android NDK targets ARM, I also had to change the Makefile to remove the -msse2 flags to progress. When I run 'make', I get: /bin/sh ../../libtool --tag=CXX --mode=compile arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c -o FIRFilter.lo FIRFilter.cpp libtool: compile: arm-eabi-g++ -DHAVE_CONFIG_H -I. -I../../include -I../../include -I/Volumes/android-build/mydroid/development/ndk/build/platforms/android-3/arch-arm/usr/include/ -O3 -fcheck-new -I../../include -g -O2 -MT FIRFilter.lo -MD -MP -MF .deps/FIRFilter.Tpo -c FIRFilter.cpp -o FIRFilter.o FIRFilter.cpp:46:21: error: stdexcept: No such file or directory FIRFilter.cpp: In member function 'virtual void soundtouch::FIRFilter::setCoefficients(const soundtouch::SAMPLETYPE*, uint, uint)': FIRFilter.cpp:177: error: 'runtime_error' is not a member of 'std' FIRFilter.cpp: In static member function 'static void* soundtouch::FIRFilter::operator new(size_t)': FIRFilter.cpp:225: error: 'runtime_error' is not a member of 'std' make[2]: *** [FIRFilter.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all-recursive] Error 1 This isn't very surprising, since the -nostdlib flag was required. Android seems to have neither stdexcept nor stdlib. How can I get past this block of compiling SoundTouch? At a guess, there may be some flag I don't know about that I should use. I could refactor the code not to use stdexcept. There may be a way to pull in the original stdexcept source and reference that. I might be able to link to a precompiled stdexcept library.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >