Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Need help with Andriod

  1. #11
    Join Date
    Nov 2014
    Posts
    11
    Rep Power
    0

    Default

    UPDATE: So I've completed all the mockups in PS and did the flow for the app activities... however i have a question.. Should i use a splash page or not? even though its a social app..

  2. #12
    Join Date
    Mar 2006
    Posts
    325
    Rep Power
    0

    Default

    you could display a splash screen if your main activity needs to do stuff in the background before its contents are displayed in a view. you could use an indeterminate progress bar that you hide when the result can be displayed.

    this guy has an android and java playlist
    https://www.youtube.com/user/derekbanas
    1337

  3. #13
    Join Date
    Jul 2007
    Posts
    16,974
    Rep Power
    33

    Default

    I love seeing threads like these on techja.
    SLAPPA Phenom II AM3 Overclocking Essentials
    I HAVE HIGHEST OC ON TECHJA 4.2ghz
    4890oc beats gtx 285
    PS3 FAILCAKE
    ps3 only advantage is bluray
    4890 oc roundup
    http://miniprofile.xfire.com/bg/sh/type/0/skugpezz.png
    Mi know dem fear mi!!!!! Gigabyte 790x ud4p
    phenom 2 955@3.8ghz 24/7 stable , 4GB ddr3 1333@1.5ghz ,3850 256MB (temp card) (4890 soon),700 watt dual rail psu, (overclocking rules) my avatar represents my personality

  4. #14
    Join Date
    Nov 2014
    Posts
    11
    Rep Power
    0

    Default

    ok thanks weil!...i was abit skeptic based on this article http://cyrilmottier.com/2012/05/03/s...dont-use-them/ .... however i went ahead and did a 5 sec splash activity..

  5. #15
    Join Date
    Nov 2011
    Posts
    263
    Rep Power
    0

    Default

    Quote Originally Posted by 214marp View Post
    ok thanks weil!...i was abit skeptic based on this article http://cyrilmottier.com/2012/05/03/s...dont-use-them/ .... however i went ahead and did a 5 sec splash activity..
    Post your code , so that we can something to play around with.

    pezz

    I love seeing threads like these on techja.
    Sure beats seeing the 21146813377557th post about the hottest new cell phone, amirite?
    Phone: Nokia 1200 with Satantendo ROM v.3.3
    Laptop: (Pentium III 850 MHz, 512 MB, 60 GB)
    Console: Sega Dreamcast
    Check out my blog: http://satanforce.wordpress.com/

  6. #16
    Join Date
    Jul 2007
    Posts
    16,974
    Rep Power
    33

    Default

    Quote Originally Posted by 214marp View Post
    ok thanks weil!...i was abit skeptic based on this article http://cyrilmottier.com/2012/05/03/s...dont-use-them/ .... however i went ahead and did a 5 sec splash activity..
    If you dont have anything to load the a splash is counter productive. Thats just my preference though.

    You are making a social app. So you have tones of stuff to load. So i dont think you need a timed splash screen.
    SLAPPA Phenom II AM3 Overclocking Essentials
    I HAVE HIGHEST OC ON TECHJA 4.2ghz
    4890oc beats gtx 285
    PS3 FAILCAKE
    ps3 only advantage is bluray
    4890 oc roundup
    http://miniprofile.xfire.com/bg/sh/type/0/skugpezz.png
    Mi know dem fear mi!!!!! Gigabyte 790x ud4p
    phenom 2 955@3.8ghz 24/7 stable , 4GB ddr3 1333@1.5ghz ,3850 256MB (temp card) (4890 soon),700 watt dual rail psu, (overclocking rules) my avatar represents my personality

  7. #17
    Join Date
    Nov 2014
    Posts
    11
    Rep Power
    0

    Default

    I'm trying to setup a gridview that have 4 columns.. but having a hard pulling the images from the drawable folder... i tried the google documentation example but i dont what m doing wring... heres code


    main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:columnWidth="90dp"
    android:numColumns="auto_fit"
    android:verticalSpacing="5dp"
    android:horizontalSpacing="5dp"
    android:stretchMode="columnWidth"
    android:gravity="center"
    />
    ******************************************
    HelloGridView.java



    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.GridView;
    import android.widget.Toast;


    public class HelloGridView extends ActionBarActivity {

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

    GridView gridview = (GridView) findViewById(R.id.gridview);
    gridview.setAdapter(new ImageAdapter(this));

    gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
    Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
    }
    });
    }
    }
    ***************************************


    ImageAdapter.java


    import android.content.Context;
    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.AdapterView;
    import android.widget.BaseAdapter;
    import android.widget.GridView;
    import android.widget.ImageView;
    import android.widget.Toast;

    public class ImageAdapter extends BaseAdapter {
    private Context mContext;

    public ImageAdapter(Context c) {
    mContext = c;
    }

    public int getCount() {
    return mThumbIds.length;
    }

    public Object getItem(int position) {
    return null;
    }

    public long getItemId(int position) {
    return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView;
    if (convertView == null) { // if it's not recycled, initialize some attributes
    imageView = new ImageView(mContext);
    imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
    imageView.setScaleType(ImageView.ScaleType.CENTER_ CROP);
    imageView.setPadding(8, 8, 8, 8);
    } else {
    imageView = (ImageView) convertView;
    }

    imageView.setImageResource(mThumbIds[position]);
    return imageView;
    }

    // references to our images
    private Integer[] mThumbIds = {
    R.drawable.sample_2, R.drawable.sample_3,
    R.drawable.sample_4, R.drawable.sample_5,
    R.drawable.sample_6, R.drawable.sample_7,
    R.drawable.sample_0, R.drawable.sample_1,
    R.drawable.sample_2, R.drawable.sample_3,
    R.drawable.sample_4, R.drawable.sample_5,
    R.drawable.sample_6, R.drawable.sample_7,
    R.drawable.sample_0, R.drawable.sample_1,
    R.drawable.sample_2, R.drawable.sample_3,
    R.drawable.sample_4, R.drawable.sample_5,
    R.drawable.sample_6, R.drawable.sample_7
    };
    }

    ..this an example of wat i'm trying to achieve except it will be 4 columns instead of 3 as in the pic below
    Last edited by 214marp; Jan 29, 2015 at 11:23 AM.

  8. #18
    Join Date
    Mar 2006
    Posts
    325
    Rep Power
    0

    Default

    works for me. just had to change this android:numColumns="auto_fit" to android:numColumns="4" because my screen fits 3 columns



    1337

  9. #19
    Join Date
    Nov 2011
    Posts
    263
    Rep Power
    0

    Default

    Quote Originally Posted by wiel View Post
    works for me. just had to change this android:numColumns="auto_fit" to android:numColumns="4" because my screen fits 3 columns



    But why diid the auto fit work? Will a 4 column look good in landscape mode? Couldn't he just have changed up the android:columnWidth?
    Phone: Nokia 1200 with Satantendo ROM v.3.3
    Laptop: (Pentium III 850 MHz, 512 MB, 60 GB)
    Console: Sega Dreamcast
    Check out my blog: http://satanforce.wordpress.com/

  10. #20
    Join Date
    Mar 2006
    Posts
    325
    Rep Power
    0

    Default

    not sure what he is trying to do. since android:numColumns="auto_fit" worked, the images are probably in the wrong folder or they don't exist. if you just need 4 columns or if you don't want to ignore the width of the items I would use numcolumns
    1337

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •