android-2.1-eclair

Android 2.1 file i/o: pread fails with errno 22 (EINVAL, Invalid argument)

北慕城南 提交于 2019-12-12 13:29:22
问题 I'm doing simple file-copy operation using open(2), pread(2) and pwrite(2) as seen below (code simplified a bit). My problem is that the ::pread(2) functions fails returning -1, with [errno=22]. Note that both source and destination files are placed on SD card. This problem occurs on Android 2.1 (API level <=7, both emulator and real device), no problem when running it on Android 2.3 (API level 9). Is there a problem in my code or is it a bug in kernel/stdlib? fileSource = ::open(pcSource, O

AdMob ad in onCreate OK, but disappears if you return to activity, why?

陌路散爱 提交于 2019-12-12 03:15:01
问题 I've added an ad to my activity like follows : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.languageselection); // Create the adView adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID); // Lookup your LinearLayout assuming it�s been given // the attribute android:id="@+id/mainLayout" LinearLayout layout = (LinearLayout) findViewById(R.id.ad_layout); // Add the adView to it layout.addView(adView); // Initiate a

Android 2.1 - Rooted Revue GoogleTV - Flash Plugin Missing in Webview

帅比萌擦擦* 提交于 2019-12-11 14:32:23
问题 I am developing and testing a Android 2.1 app on my rooted revue. It needs to render Flash web videos. The app works fine if the flash web videos are launched through an external chrome browser (already installed on the rooted revue). But, I need to do some cookie manipulation. So, I need an internal Webview to launch those videos. I am getting 'Flash Pluggin Missing' error while trying to launch Flash videos through Webview. I tried installing few Flash apk plugins (available on internet for

How do we copy files and retain their read only attribute in Android?

陌路散爱 提交于 2019-12-07 12:03:05
问题 In my Android app, I would like to be able to copy a read only file and have the new version also read only. Using the setReadOnly() method on the destination file only returns false, showing that it failed, and of course checking the file itself shows that it has not had the read only attribute set. --edit-- As David Given suggests below, this only applies to files on the SD card. Internal files will behave appropriately with setReadOnly(). My manifest file has the line <uses-permission

How to add structured data to a new contact Intent

陌路散爱 提交于 2019-12-05 21:33:59
问题 I need to support Android 2.1 and up. Google posted an example of how to use the ContactsContract, but some of it used things that are available starting with API level 11, so I need to improvise, but I'm stuck. So, far I have this: String firstName = contactProperties.get("firstName"); String lastName = contactProperties.get("lastName"); String phone = contactProperties.get("phone"); String email = contactProperties.get("email"); String company = contactProperties.get("company"); String

ConnectivityManager getActiveNetworkInfo() is always null even with data traffic active

喜你入骨 提交于 2019-12-05 03:33:06
i'm working on a android project and i had the need to check for internet connection. i searched the web and i found a solution here on stackoverflow. However, i'm having problems on checking the internet state. I already searched everywhere but i can't find any solution for my problem. Here is the manifest: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> Here is the code for checking if internet is connected: cm =

How to add structured data to a new contact Intent

青春壹個敷衍的年華 提交于 2019-12-04 03:43:30
I need to support Android 2.1 and up. Google posted an example of how to use the ContactsContract, but some of it used things that are available starting with API level 11, so I need to improvise, but I'm stuck. So, far I have this: String firstName = contactProperties.get("firstName"); String lastName = contactProperties.get("lastName"); String phone = contactProperties.get("phone"); String email = contactProperties.get("email"); String company = contactProperties.get("company"); String postal = contactProperties.get("street") + ", " + contactProperties.get("city") + ", " + contactProperties

Swipe Gesture inside ListView - Android [closed]

只谈情不闲聊 提交于 2019-12-03 21:44:46
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 7 years ago . I am a newbie for Android. I got a tutorial on how to implement the `listView here : I implemented it and it is working fine. I need to implement a ViewSwitcher for the same. Like when I swipe the song, I need to get some options like play , add to queue etc., Pls go through that tutorial and pls help. I'm

Android: Custom View with object reference from attrs.xml, always null

我的梦境 提交于 2019-12-02 01:22:17
I'm trying to setup a relationship hierarchy between objects. Every object has a parent of the same type as itself, or null . I have a main.xml that contains some of these: <com.morsetable.MorseKey android:id="@+id/bi" android:layout_weight="1" custom:code=".." custom:parentKey="@id/be" android:text="@string/i" /> a res/values/attrs.xml that contains one of these: <declare-styleable name="MorseKey"> <attr name="code" format="string"/> <attr name="parentKey" format="reference"/> </declare-styleable> and a class (that is not my activity) that contains this: public class MorseKey extends Button {

How to decrease the size of image displayed on radio button in android without using new image

大憨熊 提交于 2019-12-01 10:56:20
I have designed an activity in which i have two radio button but those size are more than enough i want to decrease it i am using text size that decreases only text if layout size is decrease that decrease only view not radio button circle <RadioGroup android:id="@+id/RG1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" > <RadioButton android:id="@+id/N" android:layout_width="wrap_content" android:layout_height="30dip" android:text="Yes" android:textSize="12dip" /> <RadioButton android:id="@+id/Y" android:layout_width="wrap_content"