Re: [android-developers] Kindle Fire won't display tabs

2012-08-24 Thread Melanie Peterson
Cool, thanks!

On Thu, Aug 23, 2012 at 6:47 PM, Justin Anderson magouyaw...@gmail.comwrote:

 You actually get a response from a human being... It is pretty nice...


 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware


 On Thu, Aug 23, 2012 at 6:23 AM, Melanie Peterson 
 melanie.sue.peter...@gmail.com wrote:

 No, I didn't even know they had developer support.  I will definitely do
 that, thanks for the tip!


 On Wed, Aug 22, 2012 at 11:28 PM, Justin Anderson 
 magouyaw...@gmail.comwrote:

 Have you tried asking Amazon's developer support?

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Mon, Aug 20, 2012 at 8:37 AM, Melanie Peterson 
 melanie.sue.peter...@gmail.com wrote:

 I have an Android app that uses tabs for its start menu.  The tabs
 don't display when I port the app to a Kindle Fire.  Here's the code:

 ?xml version=1.0 encoding=utf-8?
 ScrollView
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_height=wrap_content
 android:layout_width=fill_parent
 android:isScrollContainer=true 

 LinearLayout
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=vertical 

 TabHost
 android:id=@+id/tabhost
 android:layout_width=match_parent
 android:layout_height=match_parent 

 LinearLayout
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 TabWidget
 android:id=@android:id/tabs
 android:layout_width=match_parent
 android:layout_height=wrap_content 
 /TabWidget

 FrameLayout
 android:id=@android:id/tabcontent
 android:layout_width=match_parent
 android:layout_height=match_parent 

 LinearLayout
 android:id=@+id/Beginning
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout

 LinearLayout
 android:id=@+id/Intermediate
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout

 LinearLayout
 android:id=@+id/Advanced
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout
 /FrameLayout
 /LinearLayout
 /TabHost
 /LinearLayout

 /ScrollView

 package com.myproject.project;

 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;

 import android.app.Activity;
 import android.app.Dialog;
 import android.content.Intent;
 import android.content.res.AssetManager;
 import android.database.Cursor;
 import android.graphics.Color;
 import android.graphics.Typeface;
 import android.os.Bundle;
 import android.os.Environment;
 import android.view.Gravity;
 import android.view.View;
 import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.TabHost;
 import android.widget.TabHost.TabSpec;
 import android.widget.TextView;
 import android.widget.Toast;

 public class TabsTestActivity extends Activity {

  /** Called when the activity is first created. */

  public static final String KEY_ROWID = _id;
  public static final String KEY_NAME = name;
  public static final String KEY_LEVEL = level;
  public static final String KEY_CHART = charted;
  public String extStorageDirectory = Environment
.getExternalStorageDirectory().toString();

  @Override
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main);

   PopulateDatabase();

   CopyVideoFiles();

   TabHost tabhost = (TabHost) findViewById(R.id.tabhost);
   tabhost.setup();

   TabSpec spec_beg = tabhost.newTabSpec(Beginning);
   spec_beg.setContent(R.id.Beginning);
   TextView txtTabInfo = new TextView(this);
   txtTabInfo.setText(JUST STARTING);
   Typeface font = Typeface.createFromAsset(getAssets(), danielbd.ttf);
   txtTabInfo.setTypeface(font);
   txtTabInfo.setGravity(Gravity.CENTER);
   txtTabInfo.setHeight(50);
   txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
   txtTabInfo.setTextColor(Color.parseColor(#262405));
   spec_beg.setIndicator(txtTabInfo);

   TabSpec spec_int = tabhost.newTabSpec(Intermediate

Re: [android-developers] Kindle Fire won't display tabs

2012-08-23 Thread Melanie Peterson
No, I didn't even know they had developer support.  I will definitely do
that, thanks for the tip!

On Wed, Aug 22, 2012 at 11:28 PM, Justin Anderson magouyaw...@gmail.comwrote:

 Have you tried asking Amazon's developer support?

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware



 On Mon, Aug 20, 2012 at 8:37 AM, Melanie Peterson 
 melanie.sue.peter...@gmail.com wrote:

 I have an Android app that uses tabs for its start menu.  The tabs don't
 display when I port the app to a Kindle Fire.  Here's the code:

 ?xml version=1.0 encoding=utf-8?
 ScrollView
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_height=wrap_content
 android:layout_width=fill_parent
 android:isScrollContainer=true 

 LinearLayout
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=vertical 

 TabHost
 android:id=@+id/tabhost
 android:layout_width=match_parent
 android:layout_height=match_parent 

 LinearLayout
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 

 TabWidget
 android:id=@android:id/tabs
 android:layout_width=match_parent
 android:layout_height=wrap_content 
 /TabWidget

 FrameLayout
 android:id=@android:id/tabcontent
 android:layout_width=match_parent
 android:layout_height=match_parent 

 LinearLayout
 android:id=@+id/Beginning
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout

 LinearLayout
 android:id=@+id/Intermediate
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout

 LinearLayout
 android:id=@+id/Advanced
 android:layout_width=match_parent
 android:layout_height=match_parent
 android:orientation=vertical 
 /LinearLayout
 /FrameLayout
 /LinearLayout
 /TabHost
 /LinearLayout

 /ScrollView

 package com.myproject.project;

 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;

 import android.app.Activity;
 import android.app.Dialog;
 import android.content.Intent;
 import android.content.res.AssetManager;
 import android.database.Cursor;
 import android.graphics.Color;
 import android.graphics.Typeface;
 import android.os.Bundle;
 import android.os.Environment;
 import android.view.Gravity;
 import android.view.View;
 import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.TabHost;
 import android.widget.TabHost.TabSpec;
 import android.widget.TextView;
 import android.widget.Toast;

 public class TabsTestActivity extends Activity {

  /** Called when the activity is first created. */

  public static final String KEY_ROWID = _id;
  public static final String KEY_NAME = name;
  public static final String KEY_LEVEL = level;
  public static final String KEY_CHART = charted;
  public String extStorageDirectory = Environment
.getExternalStorageDirectory().toString();

  @Override
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.main);

   PopulateDatabase();

   CopyVideoFiles();

   TabHost tabhost = (TabHost) findViewById(R.id.tabhost);
   tabhost.setup();

   TabSpec spec_beg = tabhost.newTabSpec(Beginning);
   spec_beg.setContent(R.id.Beginning);
   TextView txtTabInfo = new TextView(this);
   txtTabInfo.setText(JUST STARTING);
   Typeface font = Typeface.createFromAsset(getAssets(), danielbd.ttf);
   txtTabInfo.setTypeface(font);
   txtTabInfo.setGravity(Gravity.CENTER);
   txtTabInfo.setHeight(50);
   txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
   txtTabInfo.setTextColor(Color.parseColor(#262405));
   spec_beg.setIndicator(txtTabInfo);

   TabSpec spec_int = tabhost.newTabSpec(Intermediate);
   spec_int.setContent(R.id.Intermediate);
   txtTabInfo = new TextView(this);
   txtTabInfo.setText(GETTING THERE);
   txtTabInfo.setTypeface(font);
   txtTabInfo.setGravity(Gravity.CENTER);
   txtTabInfo.setHeight(50);
   txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
   txtTabInfo.setTextColor(Color.parseColor(#262405));
   spec_int.setIndicator

[android-developers] Kindle Fire won't display tabs

2012-08-20 Thread Melanie Peterson


I have an Android app that uses tabs for its start menu.  The tabs don't 
display when I port the app to a Kindle Fire.  Here's the code:

?xml version=1.0 encoding=utf-8?
ScrollView
xmlns:android=http://schemas.android.com/apk/res/android; 
android:layout_height=wrap_content
android:layout_width=fill_parent
android:isScrollContainer=true 

LinearLayout
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=vertical 

TabHost
android:id=@+id/tabhost
android:layout_width=match_parent
android:layout_height=match_parent 

LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

TabWidget
android:id=@android:id/tabs
android:layout_width=match_parent
android:layout_height=wrap_content 
/TabWidget

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=match_parent
android:layout_height=match_parent 

LinearLayout
android:id=@+id/Beginning
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout

LinearLayout
android:id=@+id/Intermediate
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout

LinearLayout
android:id=@+id/Advanced
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout
/FrameLayout
/LinearLayout
/TabHost
/LinearLayout

/ScrollView

package com.myproject.project;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.AssetManager;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Environment;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;
import android.widget.Toast;

public class TabsTestActivity extends Activity {

 /** Called when the activity is first created. */

 public static final String KEY_ROWID = _id;
 public static final String KEY_NAME = name;
 public static final String KEY_LEVEL = level;
 public static final String KEY_CHART = charted;
 public String extStorageDirectory = Environment
   .getExternalStorageDirectory().toString();

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  PopulateDatabase();

  CopyVideoFiles();

  TabHost tabhost = (TabHost) findViewById(R.id.tabhost);
  tabhost.setup();

  TabSpec spec_beg = tabhost.newTabSpec(Beginning);
  spec_beg.setContent(R.id.Beginning);
  TextView txtTabInfo = new TextView(this);
  txtTabInfo.setText(JUST STARTING);
  Typeface font = Typeface.createFromAsset(getAssets(), danielbd.ttf);
  txtTabInfo.setTypeface(font);
  txtTabInfo.setGravity(Gravity.CENTER);
  txtTabInfo.setHeight(50);
  txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
  txtTabInfo.setTextColor(Color.parseColor(#262405));
  spec_beg.setIndicator(txtTabInfo);

  TabSpec spec_int = tabhost.newTabSpec(Intermediate);
  spec_int.setContent(R.id.Intermediate);
  txtTabInfo = new TextView(this);
  txtTabInfo.setText(GETTING THERE);
  txtTabInfo.setTypeface(font);
  txtTabInfo.setGravity(Gravity.CENTER);
  txtTabInfo.setHeight(50);
  txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
  txtTabInfo.setTextColor(Color.parseColor(#262405));
  spec_int.setIndicator(txtTabInfo);

  TabSpec spec_adv = tabhost.newTabSpec(Advanced);
  spec_adv.setContent(R.id.Advanced);
  txtTabInfo = new TextView(this);
  txtTabInfo.setText(REALLY GOOD);
  txtTabInfo.setTypeface(font);
  txtTabInfo.setGravity(Gravity.CENTER);
  txtTabInfo.setHeight(50);
  txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
  txtTabInfo.setTextColor(Color.parseColor(#262405));
  spec_adv.setIndicator(txtTabInfo);

  // get data from database, create buttons and name them
  SQLData myTable = new SQLData(this);
  

[android-developers] Can't display video in VideoView

2012-06-11 Thread Melanie Peterson
I'm trying to play a video in a VideoView and I'm failing miserably.
I'm working in an Eclipse emulator and am half expecting it not to
work there, but when I install my app on my Android phone (version
2.2.1) it also fails.  The error message I get is Cannot play video.
Sorry, this video cannot be played. The video is in the Raw folder.
Below is my code.  parsedData[3].toString() is the name of the video
(without the 3gp extension) which is being extracted from a database
call.  What am I doing wrong?

VideoView videoview = (VideoView) findViewById(R.id.videoView);
videoview.setMediaController(new MediaController(this));
String path = android.resource:// + getPackageName() + /R.raw/
+ parsedData[3].toString();
videoview.setVideoURI(Uri.parse(path));
videoview.requestFocus();

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] PNG file won't display in ImageView when src is set programatically

2012-06-08 Thread Melanie Peterson
I have a png file in my res/drawable-ldpi folder. I'm working in
Eclipse with the emulator, but I've tried this on my 2.2.1 Android
phone and I get the same behavior.  I have an ImageView and I want to
set the src programatically, based on a database call.  If I just put

src=@drawable.norusdpyr

in the Activity's XML file, the file displays fine.  BUT, if I put

String imageresource = R.drawable. + parsedData[4].toString();
chart.setImageURI(Uri.parse(imageresource));

where parsedData[4].toString() = nor_usdpyr I don't see anything.
I've also tried

String imageresource = android.resource:// + getPackageName() +
/R.drawable. + parsedData[4].toString();
chart.setImageURI(Uri.parse(imageresource));

and

InputStream is = getClass().getResourceAsStream(/drawable/ +
parsedData[4].toString());
chart.setImageDrawable(Drawable.createFromStream(is, ));

and

String imageresource = R.drawable. +
parsedData[4].toString();
File file = new File(imageresource);
 
chart.setImageDrawable(Drawable.createFromPath(file.getAbsolutePath()));

and

Context context = getApplicationContext();
int ResID = context.getResources().getIdentifier(imageresource,
drawable, com.KnitCard.project);
chart.setImageResource(ResID);

finally even,

chart.setImageURI(Uri.parse(android.resource:// +
getPackageName() + /R.drawable.nor_usdpyr));

None of these work.  What am I doing wrong?  Thanks!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android buttons in tabs disappear with api under 11

2012-06-04 Thread Melanie Peterson

0down votefavorite

share [g+]share [fb]share [tw]



I'm an Android noob and I'm writing an application that has 3 tabs
with buttons added to the tabs dynamically in code. This works fine
with API 11 or up, but not with any lower API. I don't get an error
message with a lower API, the buttons just don't display. However, I
can click/touch just under the tab title and the button will fire
properly. My code is below. Any ideas? Thanks!

?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 

TabHost
android:id=@+id/tabhost
android:layout_width=match_parent
android:layout_height=match_parent 

LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

TabWidget
android:id=@android:id/tabs
android:layout_width=match_parent
android:layout_height=wrap_content 
/TabWidget

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=match_parent
android:layout_height=match_parent 

LinearLayout
android:id=@+id/Beginning
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout

LinearLayout
android:id=@+id/Intermediate
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout

LinearLayout
android:id=@+id/Advanced
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 
/LinearLayout
/FrameLayout
/LinearLayout
/TabHost

/LinearLayout

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

TabHost tabhost = (TabHost) findViewById(R.id.tabhost);
tabhost.setup();

TabSpec spec_beg = tabhost.newTabSpec(Beginning);
spec_beg.setContent(R.id.Beginning);
TextView txtTabInfo = new TextView(this);
txtTabInfo.setText(JUST STARTING);
Typeface font = Typeface.createFromAsset(getAssets(),
danielbd.ttf);
txtTabInfo.setTypeface(font);
txtTabInfo.setGravity(Gravity.CENTER);
txtTabInfo.setHeight(50);
txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
txtTabInfo.setTextColor(Color.parseColor(#262405));
spec_beg.setIndicator(txtTabInfo);

TabSpec spec_int = tabhost.newTabSpec(Intermediate);
spec_int.setContent(R.id.Intermediate);
txtTabInfo = new TextView(this);
txtTabInfo.setText(GETTING THERE);
txtTabInfo.setTypeface(font);
txtTabInfo.setGravity(Gravity.CENTER);
txtTabInfo.setHeight(50);
txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
txtTabInfo.setTextColor(Color.parseColor(#262405));
spec_int.setIndicator(txtTabInfo);

TabSpec spec_adv = tabhost.newTabSpec(Advanced);
spec_adv.setContent(R.id.Advanced);
txtTabInfo = new TextView(this);
txtTabInfo.setText(REALLY GOOD);
txtTabInfo.setTypeface(font);
txtTabInfo.setGravity(Gravity.CENTER);
txtTabInfo.setHeight(50);
txtTabInfo.setBackgroundColor(Color.parseColor(#CCDE8A));
txtTabInfo.setTextColor(Color.parseColor(#262405));
spec_adv.setIndicator(txtTabInfo);

// get data from database, create buttons and name them
SQLData myTable = new SQLData(this);
myTable.open();
Cursor c = myTable.getallData();

int iRow = c.getColumnIndex(KEY_ROWID);
int iName = c.getColumnIndex(KEY_STITCHNAME);
int iLevel = c.getColumnIndex(KEY_LEVEL);

// create the buttons
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
final String RowNum = c.getString(iRow);
String StitchName = c.getString(iName);
String StitchLevel = c.getString(iLevel);
Button button = new Button(this);
button.setText(StitchName);
button.setHeight(20);
button.setTextColor(Color.BLACK);
button.setBackgroundColor(Color.parseColor(#A89E0A));
button.setHighlightColor(Color.WHITE);
button.setTypeface(font);
button.setOnClickListener(new Button.OnClickListener() {

public void onClick(View v) {
Intent choice = new

[android-developers] Can't push file to SD card using Eclipse emulator

2012-06-04 Thread Melanie Peterson

0down votefavorite

share [g+]share [fb]share [tw]



I'm trying to push a 3GP file to the Eclipse emulator. I open the
emulator and in Eclipse go to the DDMS perspective. In File Explorer,
I open /mnt and highlight sdcard. I click on the Push a file onto the
device button and choose my 3GP file. Nothing happens. I don't get an
error message, but I don't see my file under sdcard either. Any ideas
why this is happening? The permissions on the sdcard are d---rwxr-x.

Does it matter that the 3GP file is also in my project under the raw
folder? Just a shot in the dark...

Any ideas/suggestions are most welcome. Thank you!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en