Search Results

Search found 12035 results on 482 pages for 'android emulator'.

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

  • How do you set Android ViewPager to encompass only one View or Layout?

    - by Kyle
    I am struggling with the concepts needed to properly implement a view pager. By following some tutorials and referencing developer.android.com, I am able to get a view pager almost fully functional. The pager will flip through several text views that have been setup to say "My Message 0" through "My Message 9". The problem is that the view pager also flips the button on the bottom of the activity and the red block that is right above the button. I would like to have the view pager only cycle through the text. Would you please help me understand what I'm doing wrong? I have an activity that represents a dashboard: public class DashBoard extends FragmentActivity { private static final int NUMBER_OF_PAGES = 10; private ViewPager mViewPager; private MyFragmentPagerAdapter mMyFragmentPagerAdapter; public void onCreate(Bundle icicle){ super.onCreate(icicle); setContentView(R.layout.dashboard); mViewPager = (ViewPager) findViewById(R.id.viewpager); mMyFragmentPagerAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager()); mViewPager.setAdapter(mMyFragmentPagerAdapter); } private static class MyFragmentPagerAdapter extends FragmentPagerAdapter{ public MyFragmentPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int index) { return PageFragment.newInstance("My Message " + index); } @Override public int getCount(){ return NUMBER_OF_PAGES; } } and a class for the page fragment: public class PageFragment extends Fragment { public static PageFragment newInstance(String title){ PageFragment pageFragment = new PageFragment(); Bundle bundle = new Bundle(); bundle.putString("title", title); pageFragment.setArguments(bundle); return pageFragment; } @Override public void onCreate(Bundle icicle){ super.onCreate(icicle); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle icicle){ View view = inflater.inflate(R.layout.dashboard, container, false); TextView textView = (TextView) view.findViewById(R.id.textViewPage); textView.setText(getArguments().getString("title")); return view; } } and finally, my xml for the dashboard: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/dashbaordLabel" android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" /> <TextView android:id="@+id/textViewPage" android:layout_width = "match_parent" android:layout_height= "wrap_content" /> <Button android:id="@+id/newGoalButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/stringNewGoal" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:onClick="createNewGoal" /> <RelativeLayout android:id="@+id/SpaceBottom" android:layout_width="match_parent" android:layout_height="75dp" android:layout_above="@id/newGoalButton" android:background="@color/red" > </RelativeLayout> </RelativeLayout> A note about my xml, I tried wrapping the text view in some view pager tags eg: <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" > <TextView android:id="@+id/textViewPage" android:layout_width = "match_parent" android:layout_height= "wrap_content" /> </android.support.v4.view.ViewPager> But all that did was make the text view disappear from the screen, while the button and red block still cycled as in the original issue.

    Read the article

  • Changing the Android emulator locale automatically

    - by Christopher
    For automated testing (using Hudson) I have a script that generates a bunch of emulators for many combinations of Android OS version, screen resolution, screen density and language. This works fine, except for the language part. I need to find a way to change the Android system locale automatically. Here's some approaches I can think of, in order of preference: Extracting/editing/repacking a QEMU image directly before starting the emulator Running some sort of system-locale-changing APK on the emulator after startup Changing the locale settings on the emulator filesystem after startup Changing the locale settings in some SQLite DB on the emulator after startup Running a key sequence (via the emulator's telnet interface) that would open the settings app and change the locale Manually starting the emulator for each platform version, changing the locale by hand in the settings, saving it and archiving the images for later deployment Any ideas whether this can be done, either via the above methods or otherwise? Do you know where locale settings are persisted to/read from by the system? Solution: Thanks to dtmilano's info about the relevant properties, and some further investigation on my part, I came up with a solution even better and simpler simpler than all the ideas above! I have updated the answer below with the details.

    Read the article

  • Andorid - Display HTML Formatted String

    - by Soren
    I need an example how to display the strings that I have marked up with simple html into a TextView. I have found "Spanned fromHtml(String source)", but I don't know how to plug it into my java code. Here is my Java: package com.SorenWinslow.TriumphHistory; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; public class TriumphHistory extends ListActivity { String[] HistoryList; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ArrayAdapter<String> adapter; HistoryList = getResources().getStringArray(R.array.history); adapter = new ArrayAdapter<String> (this,R.layout.historylistlayout,HistoryList); setListAdapter(adapter); } } Here is a sample of history: <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="history"> <item><b>1883</b><br/>Some stuff happened</item> <item><b>1884</b><br/>Some more stuff happened <i>before</i> the other stuff </item> <resources> Here is my historylistlayout.xml: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center_vertical" android:textColor="#ffffff" android:background="#000050" android:layout_marginTop="5px" android:minHeight="?android:attr/listPreferredItemHeight" android:padding="3px" android:textSize="8pt" android:layout_gravity="top|left"/> And here is my main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:textColor="#ffffff" android:background="#000080" android:isScrollContainer="true" android:layout_height="fill_parent" android:layout_width="fill_parent" android:scrollbarStyle="insideOverlay"> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:clickable="true" android:dividerHeight="1px"/> </LinearLayout>

    Read the article

  • Can I use android.os.* libraries in a standalone project?

    - by medicdave
    I'm trying to develop an external library (not sure if that's the right term) to provide prepackaged functionality in Android projects. Working in Eclipse, I've added the appropriate android.jar file to the build path, and everything is happy both while editing and upon compilation. However, when I use Android's Handler and Message classes (android.os.Handler, android.os.Message) for inter-thread communication, I get exceptions unless I'm running within an Android app, on the emulator or a device. I can no longer test my library in a "standalone" way without having to go through a running Android target. Is there any way for me to include these two Android classes and still be able to test my library standalone? Do I need to have the Android source available? Or would it require some sort of conditional compilation hand-waving?

    Read the article

  • Android project problem

    - by qwerty
    Hello, here I uploaded my Android project made in Eclipse. The idea is that i have a service, which computes the sum of two random numbers. But when i press the OK Button, i don't see the result in that edit box... why? What i'm doing wrong? Please help Thanks! EDIT: The code: //service class package service; import java.util.Random; import com.android.AplicatieSuma; import android.widget.EditText; import android.widget.TextView; public class ServiciuSuma { public ServiciuSuma() { } public int CalculateSum() { Random generator=new Random(); int n=generator.nextInt(); int m=generator.nextInt(); return n+m; } } The Application class: package com.android; import android.app.*; import service.*; public class ApplicationSum extends Application { public ServiciuSuma service = new ServiciuSuma(); } and the main Activity class: package com.android; import com.android.R; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.graphics.PorterDuff; import android.os.Bundle; import android.provider.Settings; import android.view.View; import android.view.View.OnClickListener; import android.widget.EditText; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; public class Activitate extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); View btn_ok = findViewById(R.id.btn_ok); btn_ok.setOnClickListener(new OnClickListener() { public void onClick(View v) { CalculeazaSuma(); } }); } private void CalculeazaSuma() { AplicatieSuma appState = ((AplicatieSuma)this.getApplication()); EditText txt_amount = (EditText)findViewById(R.id.txt_amount); txt_amount.setText(appState.service.CalculateSum()); //BindData(); } } So that edit text does not show the sum of the random generated numbers, by the service. What's wrong? Thanks EDIT: the manifest xml file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android" android:versionCode="1" android:versionName="1.0.1"> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true" /> <application android:name="ApplicationSum" android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> <activity android:label="@string/app_name" android:name=".Activitate"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" /> </manifest>

    Read the article

  • Android Augmented Reality

    - by Azooz Totti
    I'm working on my first Android Augmented Reality application. The application works pretty good if the ARActivity runs as the first class (android.intent.category.LAUNCHER) in the manifest file. But when I added a splash screen which means the ARActivity will be the second to run(android.intent.category.DEFAULT), the camera seems not detecting the marker. I believe the problem is all in the manifest file. Any suggestions ? Thanks This is the manifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ar.armarkers" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Splash" android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.ar.armarkers.MainActivity" android:clearTaskOnLaunch="true" android:label="@string/title_activity_main" android:noHistory="true" android:screenOrientation="landscape" > <intent-filter> <action android:name="com.ar.armarkers.MAINACTIVITY" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application> </manifest> MainActivity.java import edu.dhbw.andar.ARObject; import edu.dhbw.andar.ARToolkit; import edu.dhbw.andar.AndARActivity; import edu.dhbw.andar.exceptions.AndARException; import edu.dhbw.andar.pub.CustomRenderer; import android.os.Bundle; import android.util.Log; public class MainActivity extends AndARActivity { private ARObject someObject; private ARToolkit artoolkit; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CustomRenderer renderer = new CustomRenderer(); setNonARRenderer(renderer); try { artoolkit = getArtoolkit(); someObject = new CustomObject1("test", "marker16.pat", 80.0, new double[] { 0, 0 }); artoolkit.registerARObject(someObject); someObject = new CustomObject2 ("test", "marker17.patt", 80.0, new double[]{0,0}); artoolkit.registerARObject(someObject); } catch (AndARException ex) { System.out.println(""); } startPreview(); } public void uncaughtException(Thread thread, Throwable ex) { // TODO Auto-generated method stub Log.e("AndAR EXCEPTION", ex.getMessage()); finish(); } } Splash.java import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.os.Bundle; import android.view.Gravity; public class Splash extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.splash); Thread timer = new Thread() { public void run() { try { sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } finally { Intent i = new Intent(getApplicationContext(), MainActivity.class); startActivity(i); } } }; timer.start(); } }

    Read the article

  • Problem using setEmptyView on a ListActivity

    - by Pentium10
    I have the following setup, and the empty view text doesn't show up... protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getListView().setEmptyView(findViewById(R.id.empty)); getListView().setTextFilterEnabled(true); setListAdapter(null);// to have empty list } The layout file is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/myScrollLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <FrameLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1"> <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawSelectorOnTop="false" /> <!-- Here is the view to show if the list is emtpy --> <ScrollView android:id="@android:id/empty" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/emptyText" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/contact_empty_help" android:textSize="20sp" android:textColor="?android:attr/textColorSecondary" android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingTop="10dip" android:lineSpacingMultiplier="0.92" /> </ScrollView> </FrameLayout> </LinearLayout> String is defined as: <string name="contact_empty_help">"You don't have any contacts to display.\n\nTo add contacts, you have to:\n \n<li><font fgcolor="#ffffffff">Go to <b>Contacts</b></font> application to create new contacts\n</li> \n<li><font fgcolor="#ffffffff"><b>Import from VCF file</b></font>, this is available in Contacts menu, the file most be on the root of the SD card\n</li>" </string> Since the list is empty, it should show me the text defined. I followed the example from the List8 http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List8.html http://developer.android.com/intl/de/resources/samples/ApiDemos/res/layout/list_8.xml

    Read the article

  • 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

  • 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

  • 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

  • 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

  • Emulate disk IO speeds in Android SDK

    - by Ben L.
    I don't have a physical Android device to work with, so all I can use is the emulator. I'm wondering if there's something I could use to make the IO speeds more realistic - How do I slow down disk access to the speed it would be on a physical device? Also, this may be unrelated, but when I change the speed and latency options in Eclipse ADT DDMS view, I don't notice any change in internet speed on the emulator. Is this a bug?

    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

  • Marking Current Location on Map, Android

    - by deewangan
    Hi every one, i followed some tutorials to create an application that shows the current position of the user on the map with a marking. but for some reasons i can't get to work the marking part? the other parts works well, but whenever i add the marking code the application crashes. i hope someone could help me.here is the code: public class LocationActivity extends MapActivity { /** Called when the activity is first created. */ private MapView mapView; private LocationManager lm; private LocationListener ll; private MapController mc; GeoPoint p = null; Drawable defaultMarker = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView)findViewById(R.id.mapView); //show zoom in/out buttons mapView.setBuiltInZoomControls(true); //Standard view of the map(map/sat) mapView.setSatellite(false); //get controller of the map for zooming in/out mc = mapView.getController(); // Zoom Level mc.setZoom(18); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(); List<Overlay> list = mapView.getOverlays(); list.add(myLocationOverlay); lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); ll = new MyLocationListener(); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, ll); //Get the current location in start-up GeoPoint initGeoPoint = new GeoPoint( (int)(lm.getLastKnownLocation( LocationManager.GPS_PROVIDER) .getLatitude()*1000000), (int)(lm.getLastKnownLocation( LocationManager.GPS_PROVIDER) .getLongitude()*1000000)); mc.animateTo(initGeoPoint); } protected class MyLocationOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { Paint paint = new Paint(); super.draw(canvas, mapView, shadow); // Converts lat/lng-Point to OUR coordinates on the screen. Point myScreenCoords = new Point(); mapView.getProjection().toPixels(p, myScreenCoords); paint.setStrokeWidth(1); paint.setARGB(255, 255, 255, 255); paint.setStyle(Paint.Style.STROKE); Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.push); canvas.drawBitmap(bmp, myScreenCoords.x, myScreenCoords.y, paint); canvas.drawText("I am here...", myScreenCoords.x, myScreenCoords.y, paint); return true; } } private class MyLocationListener implements LocationListener{ public void onLocationChanged(Location argLocation) { // TODO Auto-generated method stub GeoPoint myGeoPoint = new GeoPoint( (int)(argLocation.getLatitude()*1000000), (int)(argLocation.getLongitude()*1000000)); /* * it will show a message on * location change Toast.makeText(getBaseContext(), "New location latitude [" +argLocation.getLatitude() + "] longitude [" + argLocation.getLongitude()+"]", Toast.LENGTH_SHORT).show(); */ mc.animateTo(myGeoPoint); } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } } protected boolean isRouteDisplayed() { return false; } } here is the logcat: 01-19 05:31:43.011: DEBUG/AndroidRuntime(759): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 01-19 05:31:43.011: DEBUG/AndroidRuntime(759): CheckJNI is ON 01-19 05:31:43.411: DEBUG/AndroidRuntime(759): --- registering native functions --- 01-19 05:31:43.431: INFO/jdwp(759): received file descriptor 19 from ADB 01-19 05:31:43.431: INFO/jdwp(759): Ignoring second debugger -- accepting and dropping 01-19 05:31:44.531: INFO/ActivityManager(583): Starting activity: Intent { flg=0x10000000 cmp=pro.googlemapp/.LocationActivity } 01-19 05:31:44.641: DEBUG/AndroidRuntime(759): Shutting down VM 01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM waiting for non-daemon threads to exit 01-19 05:31:44.641: DEBUG/dalvikvm(759): DestroyJavaVM shutting VM down 01-19 05:31:44.641: DEBUG/dalvikvm(759): HeapWorker thread shutting down 01-19 05:31:44.651: DEBUG/dalvikvm(759): HeapWorker thread has shut down 01-19 05:31:44.651: DEBUG/jdwp(759): JDWP shutting down net... 01-19 05:31:44.651: DEBUG/jdwp(759): +++ peer disconnected 01-19 05:31:44.651: INFO/dalvikvm(759): Debugger has detached; object registry had 1 entries 01-19 05:31:44.661: DEBUG/dalvikvm(759): VM cleaning up 01-19 05:31:44.681: INFO/ActivityManager(583): Start proc pro.googlemapp for activity pro.googlemapp/.LocationActivity: pid=770 uid=10025 gids={3003} 01-19 05:31:44.761: DEBUG/dalvikvm(759): LinearAlloc 0x0 used 676436 of 4194304 (16%) 01-19 05:31:44.801: INFO/jdwp(770): received file descriptor 20 from ADB 01-19 05:31:44.822: INFO/dalvikvm(770): ignoring registerObject request in thread=3 01-19 05:31:44.851: INFO/jdwp(770): Ignoring second debugger -- accepting and dropping 01-19 05:31:44.851: ERROR/jdwp(770): Failed writing handshake bytes: Broken pipe (-1 of 14) 01-19 05:31:44.851: INFO/dalvikvm(770): Debugger has detached; object registry had 0 entries 01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.320: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.340: ERROR/ActivityThread(770): Failed to find provider info for com.google.settings 01-19 05:31:45.781: DEBUG/LocationManager(770): Constructor: service = android.location.ILocationManager$Stub$Proxy@4379d9f0 01-19 05:31:45.791: WARN/GpsLocationProvider(583): Duplicate add listener for uid 10025 01-19 05:31:45.791: DEBUG/GpsLocationProvider(583): setMinTime 0 01-19 05:31:45.791: DEBUG/GpsLocationProvider(583): startNavigating 01-19 05:31:45.831: INFO/jdwp(770): received file descriptor 27 from ADB 01-19 05:31:46.001: INFO/MapActivity(770): Handling network change notification:CONNECTED 01-19 05:31:46.001: ERROR/MapActivity(770): Couldn't get connection factory client 01-19 05:31:46.451: DEBUG/dalvikvm(770): GC freed 4539 objects / 298952 bytes in 118ms 01-19 05:31:46.470: DEBUG/AndroidRuntime(770): Shutting down VM 01-19 05:31:46.470: WARN/dalvikvm(770): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 01-19 05:31:46.481: ERROR/AndroidRuntime(770): Uncaught handler: thread main exiting due to uncaught exception 01-19 05:31:46.541: ERROR/AndroidRuntime(770): java.lang.NullPointerException 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:58) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.PixelConverter.toPixels(PixelConverter.java:48) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at pro.googlemapp.LocationActivity$MyLocationOverlay.draw(LocationActivity.java:101) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.google.android.maps.MapView.onDraw(MapView.java:476) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6274) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1526) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1524) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6277) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1526) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.drawChild(ViewGroup.java:1524) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.View.draw(View.java:6277) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.draw(ViewRoot.java:1332) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.os.Handler.dispatchMessage(Handler.java:99) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.os.Looper.loop(Looper.java:123) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at java.lang.reflect.Method.invokeNative(Native Method) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at java.lang.reflect.Method.invoke(Method.java:521) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-19 05:31:46.541: ERROR/AndroidRuntime(770): at dalvik.system.NativeStart.main(Native Method) 01-19 05:31:46.551: INFO/Process(583): Sending signal. PID: 770 SIG: 3 01-19 05:31:46.581: INFO/dalvikvm(770): threadid=7: reacting to signal 3 01-19 05:31:46.661: INFO/dalvikvm(770): Wrote stack trace to '/data/anr/traces.txt' 01-19 05:31:46.871: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x2c69c8:0x2c6a6c] in 973448 ns 01-19 05:31:46.911: INFO/ARMAssembler(583): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x2c6a70:0x2c6bc0] in 1985378 ns 01-19 05:31:49.881: INFO/Process(770): Sending signal. PID: 770 SIG: 9 01-19 05:31:49.931: INFO/ActivityManager(583): Process pro.googlemapp (pid 770) has died. 01-19 05:31:49.941: WARN/GpsLocationProvider(583): Unneeded remove listener for uid 1000 01-19 05:31:49.941: DEBUG/GpsLocationProvider(583): stopNavigating 01-19 05:31:49.951: INFO/WindowManager(583): WIN DEATH: Window{438891c0 pro.googlemapp/pro.googlemapp.LocationActivity paused=false} 01-19 05:31:50.111: WARN/UsageStats(583): Unexpected resume of com.android.launcher while already resumed in pro.googlemapp 01-19 05:31:50.200: WARN/InputManagerService(583): Got RemoteException sending setActive(false) notification to pid 770 uid 10025

    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

  • Android SDK vs NDK in oppurtunities and career scope

    - by Gopal S Akshintala
    Hi I am very much interested in Android Mobile Developement and I am equally comfortable with Java and C/C++. I would like to build my career in Android. So I am confused on to which way to go, wheather as Android SDK developer or NDK developer. Please advice me pros n cons of both and also the career scope and oppurtunities in both(With factors like excitement in Job, Payroll, competetion, Openings in Job Market, career growth etc).Thanks...:)

    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

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