Sunday, November 17, 2013

How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8? [android help]


How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8?


android - How can Google make it possible to use ActionBar in Google Shopper app, which only requires a min SDK of 8? - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
















I'm confused with this fact, and I think some feature must require


getActionBar()


and this function requires a min SDK of 11, but how can Google make those features possible?


I wonder Google may use ActionBarSherlock, is this just the reason? But there is no mention of using it, but how can Google do this?


Thanks for your answering.





























Google is actually working on ActionBarCompat . It's basically a ActionBarSherlock from Google.
I suppose they are testing this in some apps already since they said at Google I/O that it is in an advanced state of development. I think they will release this in the next few months.
























but how can Google make those features possible?



They made their own action bar, presumably.



I wonder Google may use ActionBarSherlock, is this just the reason?



You are welcome to get a job with Google, attempt to join the Google Shopper team, and ask them.



And have anyone ever use ActionBarSherlock on Android 2.2, plz tell me if it can make things just as well as ActionBar?



ActionBarSherlock definitely supports Android 2.2.




















default






Read more

stackoverflow.comm



Admob in xml not showing in Linear [android help]


Admob in xml not showing in Linear


android - Admob in xml not showing in Linear - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
















i am implementing admob on my app it appears when the parent is in relative layout but i must not use the alignparentbottom so i am changing it to linear but it doesnt show when i change it to linear..


any tips? help? thanks in advance


here it is in xml:




android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

android:id="@+id/banner_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

android:id="@+id/offline_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@color/black"
android:src="@drawable/offline_banner" />

xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/unit_id"
ads:loadAdOnCreate="true" />

android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />



i want the admob to be at the bottom part of the screen without using the alignparentbottom of relative layout


thanks~



















lang-xml






Read more

stackoverflow.comm



Listview not showing on orientation Change [android help]


Listview not showing on orientation Change



I have previously done a listview and the list is being displayed whether in landscape or portrait orientation. However, in my new app, when I decide to change orientation, whether landscape to portrait or vice versa, it does not load again. I am trying to populate the listview with items from sqlite database. Here is my code:


Attractions.java



public class Attractions extends ListActivity {
DataBaseHandler db = new DataBaseHandler(this);
ArrayList imageArry = new ArrayList();
ContactImageAdapter adapter;
int ctr, loaded;
int [] landmarkImages={R.drawable.oblation,R.drawable.eastwood,R.drawable.ecopark,R.drawable.circle};
String []landmarkDetails = { "Oblation", "Eastwood", "Ecopark", "QC Circle"};

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_attractions);
ctr = db.checkContact(landmarkDetails[loaded]);
db.deleteAll();


// get image from drawable

/**
* CRUD Operations
* */
// Inserting Contacts
Log.d("Insert: ", "Inserting ..");


for(loaded=0; loaded
Bitmap image = BitmapFactory.decodeResource(getResources(),
landmarkImages[loaded]);

// convert bitmap to byte
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte imageInByte[] = stream.toByteArray();
Log.d("Going to load images", "Image "+ loaded);

Log.d("Goind to load objects", "loading");

if(ctr == 0){
Log.d("Nothing Loaded", "Loading Now");
db.addContact(new Contact(landmarkDetails[loaded], imageInByte));}
Log.d(landmarkDetails[loaded], "Loaded!");
image.recycle();
}


// Reading all contacts from database
List contacts = db.getAllContacts();
for (Contact cn : contacts) {
String log = "ID:" + cn.getID() + " Name: " + cn.getName()
+ " ,Image: " + cn.getImage();

// Writing Contacts to log
Log.d("Result: ", log);
//add contacts data in arrayList
imageArry.add(cn);

}
adapter = new ContactImageAdapter(this, R.layout.screen_list,
imageArry);
ListView dataList = (ListView) findViewById(android.R.id.list);
dataList.setAdapter(adapter);
}


UPDATE


I ran the app on portrait mode: list present, when switched to landscape: does not display anything. I switch to portrait again: list present again.



Read more

stackoverflow.comm



Linking to image in sdcard PhoneGap [android help]


Linking to image in sdcard PhoneGap



I have a saved image in android "mnt/sdcard/offlineImages" folder. The image is named img_0.jpg.


Now I want to display this image on a html page via javascript.


I tried the following two cases.


CASE ONE WHICH WORKS.



html


javaScript
document.getElementById('anImg').src = "file:///mnt/sdcard/offlineImages/img_0.jpg";


CASE TWO, WHICH DOESN'T WORK.



html


javascript
var anImg = new Image();
anImg.src = "file:///mnt/sdcard/offlineImages/img_0.jpg";
document.getElementById("img_wrap").appendChild(anImg);


Read more

stackoverflow.comm



Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...