Thursday, May 2, 2013

[General] Popup applications not working - new samsung galaxy s3


Hi,

I just got a "new" samsung galaxy s3 a few days ago and the only problem I've come across so far is that none of the sms pop up apps I download work. I've used SMS Popup on my previous phones in conjunction with Handcent SMS with no problem. I'm frustrated because I can't figure out why NONE of the apps, SMS 7, Popup Notifier, or SMS Popup, will work. And when I say doesn't work I mean I can open the app and change the settings, but nothing ever happens when I get a text - no popup, no notification, no sound, no LED light. But I've tried the Handcent pop up and it works just fine? I really want to figure out what's going on because the pop up that comes with Handcent drives me crazy. If anyone can shed some light on my situation I'd really appreciate it!

Thanks!



.

forum.xda-developers.com

[android help] Source Not Found Error Beginning Android 4 Application Development by Wei-Meng Lee, Eclipse REPOST


THIS IS A RE-POST. I VERY MUCH NEED HELP! I am a Android beginner going through a book right now thats teaching me android called Android 4 Application Development by We-Meng Lee. I am making a project that uses a preference fragment. However. When I try to run it, It takes me to a screen back in eclipse that says "Source Not found "cmp=net.learn2develop.PreferenceFragmentExample/.PreferenceFragmentExampleActivity Here is my code for preferences.xml.




xmlns:android="http://schemas.android.com/apk/res/android" >


android:title="Checkbox"
android:defaultValue="false"
android:summary="True of False"
android:key="checkboxPref" />



android:name="EditText"
android:summary="Enter A string"
android:defaultValue="[Enter a string here]"
android:title="Edit Text"
android:key="editTextPref" />
android:name="Ringtone Preference"
android:summary="Select a Ringtone"
android:title="Ringtones"
android:key="ringtonePref" />
android:title="Second Preference Screen"
android:summary="Click Here To Go To The Second Preference Screen"
android:key="secondPrefScreenPref" />
android:name="EditText"
android:summary="Enter A string"
android:title="Edit Text (second Screen)"
android:key="secondEditTextPref" />



Here is my code for my Fragment1.java file.



package net.learn2develop.PreferenceFragmentExample;

import android.os.Bundle;
import android.preference.PreferenceFragment;

public class Fragment1 extends PreferenceFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

addPreferencesFromResource(R.xml.preferences);
}

}


And here is my PreferenceExampleActivity.java file



package net.learn2develop.PreferenceFragmentExample;

import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;

public class PreferenceFragmentExampleActivity extends Activity {

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

FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
Fragment1 fragment1 = new Fragment1();
fragmentTransaction.replace(android.R.id.content, fragment1);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
}


Can someone enlighten me on why this is doing this? Any help is greatly appreciated!



.

stackoverflow.comm

[android help] Custom seekbar showing gap in between, on large screens?


I made a custom seekbar using 2 png images for my android app. One image is the background, and other is the bar which shows progress. Both are of the same length and width. On small screens( ~5"), it displays perfectly. But on larger screens( ~8"), a small gap is present on the upper bar, and a small part of the lower bar is visible from that gap, as shown in picture: enter image description here


I checked the 2 .png files, and there is no problem in them. Also, this gap only shows up on big screened devices. What could be causing this?


Edit: Added the XML for the seekbar area:



android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1333333333333333"
android:scaleType="fitXY">
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:scaleType="fitXY"
android:contentDescription="@string/p"
android:src="@drawable/volbar" />
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:scaleType="fitXY"
android:minHeight="5dip"
android:maxHeight="5dip"
android:progressDrawable="@drawable/styled_progress"
android:thumb="@drawable/thumb"
android:thumbOffset="13.5dp"
android:paddingRight="13.5dp"
android:paddingLeft="13.5dp"
android:indeterminate="false" />



.

stackoverflow.comm

[android help] Zip with password in android


I was trying to give a password to my .zip file.


I am using winzipaes.


I was stuck when trying to call the AesZipFileEncrypter class



AesZipFileEncrypter aesEncryptor = new AesZipFileEncrypter(dirPath, )


what should I input for AESEncrypter?


and after get the class, is it right to use the addAll(pathToZipFile, password) function to give the .zip password?



.

stackoverflow.comm

[android help] Intent for facebook signup/register page in android

Intent for facebook signup/register page in android - 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 have a link in my application that needs to display the sign up page of Facebook. Is there and intent that i can start that will open a browser or android application to display it? Thank you.





























Yes, you can signup/register facebook page from your application. Refer the link here to know how to add up facebook activity from your application. Remember that, you need to generate APP ID from your facebook account to connect facebook from your application.























BRAND NEW APPLE IPHONE 5 -16GB $415


UNLOCKED TO ANY CARRIER


1 YEAR WARRANTY


BULK ORDERS WELCOME WITH ADDITIONAL DISCOUNTS


BUY NOW AT


http://www.dollarstar.ca


http://www.clockworkwhite.com




















default







.

stackoverflow.comm

[android help] mService is becoming null after first time. In app bill android


I am using following code to find weather this user is premium user or not. Weather the user has purchase in app billing or not. But when i call this method isPremium(). it gives right result first time only but when i do it after first time, it always give wrong result. The mService variable of IInAppBillingService is null. Can some one tell me what could be reason of it. The code is as below.



public boolean isPremium() {
boolean mIsPremium = false;
Log.d(TAG, "::isPremium:" + "mService:"+mService);
if(mService==null){
return mIsPremium;
}

try {
Bundle ownedItems = mService.getPurchases(3, getPackageName(),
"inapp", null);
if (ownedItems != null) {
int response = ownedItems.getInt("RESPONSE_CODE");
if (response == 0) {
ArrayList ownedSkus = ownedItems
.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
ArrayList purchaseDataList = ownedItems
.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
ArrayList signatureList = ownedItems
.getStringArrayList("INAPP_DATA_SIGNATURE");
String continuationToken = ownedItems
.getString("INAPP_CONTINUATION_TOKEN");

for (int i = 0; i < purchaseDataList.size(); ++i) {
String signature = null;
String purchaseData = (String) purchaseDataList.get(i);
if (signatureList != null)
signature = (String) signatureList.get(i);
String sku = (String) ownedSkus.get(i);
Log.d(TAG, "::isPremium:" + "sku:" + sku);
Log.d(TAG, "::isPremium:" + "purchaseData:"
+ purchaseData);
Log.d(TAG, "::isPremium:" + "signature:" + signature);
if (sku.equalsIgnoreCase(SKU_PREMIUM)) {
Log.d(TAG, "::isPremium:" + "Already Purchased");
return true;
}

// do something with this purchase information
// e.g. display the updated list of products owned by
// user
}

// if continuationToken != null, call getPurchases again
// and pass in the token to retrieve more items
}
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return mIsPremium;
}


The following is code to initialize service. where every time i come to service. i only get "onServiceConnected " log. and never got log ":onServiceDisconnected:"



ServiceConnection mServiceConn = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
Log.d(TAG, "::onServiceDisconnected:" + "");
mService = null;
}

@Override
public void onServiceConnected(ComponentName name, IBinder service) {
Log.d(TAG, "::onServiceConnected:" + "");
mService = IInAppBillingService.Stub.asInterface(service);

}
};


So can some one give me idea what could be reason of mService becoming null after first time ? Should we only call it 1 time only ? is my service getting disconnected ? But i could not see it in my log.



.

stackoverflow.comm

[android help] how to use GCM in android

how to use GCM in android - 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 propose a new question: I think the communication between android and server by sockets is difficult


I speak with my friends it proposes me a solution: use the GCM


month then give an idea or example uses this concept


I found this book: http://www.academia.edu/2200380/SENDING_SECURE_DATA_BETWEEN_AN_ANDROID_MOBILE_APPLICATION_AND_A_NETWORK_GROUND_STATION

And the question is, how to use gcm between server and Android?





























Communication between android and server is I believe not applicable with GCM, GCM is intended to be a server to client pushing service, for example your wish to tell your client there is some data updates you need to fetch. So your server will push a message to client, using GCM.


For client to server communication, the easiest IMO would be using some Http server or web services. As for securing you can always go for SSL.




















default






.

stackoverflow.comm

[android help] Display facebook signup page in android

Display facebook signup page in android - 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.

















Is there a way i can link users of my application to Facebook's sign up page?


I am currently using the latest facebok sdk 3.0.1 for loging in to facebook and it is working fine but i have a separate link for new users to register to facebook and I need a way to directly display the sign up page.
















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default






.

stackoverflow.comm

[android help] How to make one part of view (relativelayout) scroll, but another part not move?


I have a RelativeLayout that is a detail page for search results. It displays a bunch of different TextViews, has a table or two, and also holds a SupportMapFragment. I want that portion to be scrollable. I also have a LinearLayout that holds an EditText and a Button at the bottom of the view that should always be visible at the bottom. It's small, maybe an 1/8th of the total view height, and I just want it to always stay there.


I tried to wrap the layout I want scrolling in a ScrollView, leave the other layout out of that, and then wrap the whole thing in a RelativeLayout. The yields a scrollbar, but it doesn't move more than just a tiny, tiny bit, and when it does, there is a little black space revealed where the SupportMapFragment moves from.


How can I set up my layouts to scroll the portion I want scrolling, and leave the other portion alone? Do I need to convert this whole activity to a FragmentActivity?


The layout file I'm wrangling is here:




android:id="@+id/detailFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="12dp"
android:paddingRight="12dp" >
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_above="@+id/tagVenue"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp">
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="1dp"
android:paddingRight="1dp" >
android:id="@+id/vName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:text="Fore Street Bar and Grill"
android:textIsSelectable="true"
android:textStyle="bold" />
android:id="@+id/vAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vName"
android:layout_marginTop="5dp"
android:textIsSelectable="true"
android:text="105 Congress St. \nPortland, ME 04055"/>
android:id="@+id/vPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vAddress"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="207-555-1111"/>
android:id="@+id/vWeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vPhone"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="www.xyz.com"/>
android:id="@+id/vDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="true"
android:layout_below="@+id/map"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="100 meters away"
android:textIsSelectable="true" />

android:id="@+id/vCuisine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vWeb"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="American, Fusion"/>

android:id="@+id/vHours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vRating"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:text="Hours: 10:00 - 22:00 Currently open!"
android:textIsSelectable="true"
android:textStyle="bold" />
android:id="@+id/vRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/vCuisine"
android:textIsSelectable="true"
android:text="5 Stars"/>
android:id="@+id/dividing_line"
android:layout_height="1dp"
android:layout_width="fill_parent"
android:background="#000000"
android:layout_below="@+id/vHours"
android:layout_marginTop="5dp"/>


android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="120dip"
android:layout_height="120dip"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp" />
android:id="@+id/table1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_below="@+id/dividing_line"
android:layout_marginTop="5dp">
android:id="@+id/tableRow1a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="2">
android:id="@+id/vtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight=".7"
android:text="text"
android:textIsSelectable="true"
android:textSize="18dp"
android:textStyle="bold" />

android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1.3"
android:text="93/100"
android:textIsSelectable="true"
android:textSize="20dp"
android:textStyle="bold" />


android:id="@+id/table2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/table1"
android:layout_marginTop="5dp" >
android:id="@+id/tableRow1b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true"
android:textStyle="bold" />

android:id="@+id/tableRow3b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:id="@+id/text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag1Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />

android:id="@+id/tableRow4b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:id="@+id/vtext2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag2Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />

android:id="@+id/tableRow5b"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:id="@+id/vtext3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag3Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />

android:id="@+id/tableRow6b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:id="@+id/vtext4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag4Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />

android:id="@+id/tableRow7b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:id="@+id/vtext5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag5Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />

android:id="@+id/tableRow8b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
android:id="@+id/vtext6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
android:id="@+id/vTag6Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />




android:id="@+id/textdlfka"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/detailFragment" >
android:id="@+id/text7"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/Button01"
android:hint="@string/search" >

android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="@string/search" >





.

stackoverflow.comm

[android help] Preference cannot cast java.lang.boolean to String


I have the following Preference class:



public class AppPreferencesActivity extends PreferenceActivity {
private SharedPreferences appPrefs;
private SharedPreferences.Editor prefEditor;
private Mediator mediator;
private SharedPreferences.OnSharedPreferenceChangeListener listener;
private User user;
@SuppressWarnings("deprecation")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//---load the preferences from an XML file---
addPreferencesFromResource(R.xml.preferences);
this.appPrefs = PreferenceManager.getDefaultSharedPreferences(this);
this.mediator = (Mediator) getApplication();
this.prefEditor = appPrefs.edit();
this.user = mediator.getUser();
setPreferences();
listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
// Implementation
updatePreference(key);
Toast.makeText(AppPreferencesActivity.this,
"Information updated",
Toast.LENGTH_SHORT).show();
}
};
appPrefs.registerOnSharedPreferenceChangeListener(listener);

}
private void setPreferences(){
prefEditor.putString("nameEdit", user.getName() + " "+user.getLastName());
prefEditor.putString("streetEdit", user.getStreetName());
prefEditor.putString("streetNumberEdit", ""+user.getStreetNr());
prefEditor.putString("emailEdit", user.getEmail());
prefEditor.commit();
preferenceAddSummary();
}
public boolean checkEmailStatus(){
return appPrefs.contains("emailEdit");
}
@SuppressWarnings("deprecation")
private void preferenceAddSummary() {
for (Entry key : appPrefs.getAll().entrySet()) {
findPreference(key.getKey()).setSummary(appPrefs.getString(key.getKey(), "Not yet entered"));
// this is where im getting the error

}


However when i run this i get the following



Cannot cast Java.lang.boolean to Java.lang.String



I get this error at the loop im calling to setSumary can anyone tell me why this is happening?


UPDATE


Here is a print of my stacktrace:


enter image description here



.

stackoverflow.comm

[android help] Why does empty project have large memory allocation?

java - Why does empty project have large memory allocation? - 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 created an empty project in android. Then I ran it with an emulator that has hardware acceleration. enter image description here


50% is already allocated. and of those the smallest free chunk of memory is a measly 174 KB.


Why is this?


























Because the VM hasnt allocated more. If your memory footprint grows so will your heap size. If I remember correctly hardware acceleration also pulls some part of the renderer into your process which is why as much as 2.5 MB is already used.



By rendering all of an app’s animations and UI with the GPU, the system takes a hit to memory usage. Loading up the OpenGL drivers for each process takes memory usage of roughly 2MB,



http://www.extremetech.com/computing/107995-the-truth-about-hardware-acceleration-on-android























lang-java






.

stackoverflow.comm

[General] lost android os

PLEASE, when asking for help provide as much information as possible. Otherwise, it's like calling your doctor and saying "My head hurts." Your doctor can't treat you unless he knows whether you have a headache or a concussion, and we can't help unless we know what the symptoms are and what you did before they occurred.


Have a Galaxy S3? Click here ==> Everything you wanted to know about your Galaxy S3

New to Android Central? Click here ==>http://forums.androidcentral.com/int...tart-here.html


.

forum.xda-developers.com

[General] Problem With Google Merchant [DEVELOPER]


Hello!

i just registered and payd my google developer registration fee but to sell my games i need to register google merchant which i did before. But the problem is that it wont show that i have done it , it still says:

To start earning money with paid apps or in-app products,
set up a Google Checkout merchant account.

Set Up a merchant account now

and if i click set up a merchant account now it will just transfer me to google merchant register page and if i try to register which i have done already nothing happends.
Anybody got this problem too?



.

forum.xda-developers.com

[General] GoSMS - How to get notifications on lock screen


I have the Samsung Galaxy S4 and have the lock screen enabled with a passcode. When the phone is locked, I don't receive the pop-up notification of an incoming sms. It works fine when the phone is unlocked, just not when it's locked. I've tried Handcent as well and have the same issue.

Does anyone know how to resolve this with Go SMS?

Thanks



.

forum.xda-developers.com

[android help] Calling startActivityforResult from tab activity then Alertdialog will not show in Tabactivity


I have 3 tabs. So 3 activities will open from that tabs. In that, one tab contains 2 buttons, 1 for opening map in next activity and 1 for showing dialog. Before clicking on 1st button the 2nd button is working perfectly but once I click on that 1st(map button - fragment activity) the 2nd button is not working.


I am opening map tharough startActivityForResult() and it will return me the latitude and longitude. Then I am clicking the alert button alert will not display but application hangs for some time.


As per my sense dialog is displaying but it is not showing. i don't know what happened.


If anyone has idea then please help me.


This functionality is perfectly working in ICS.



.

stackoverflow.comm

[General] Do I have to get market license and how much does it cost?


Hello:

Our team will be developing an Android app to be used within our service area and it is not available for public to download.
I am hoping that I am asking the right questions.
Is it necessary to get some sort of licensing from Google (Since it will be running within Android)?
How much for the licensing?

Many thanks,



.

forum.xda-developers.com

[android help] Easy way to make an ImageView that is underneath a GridView match the GridView's size exactly?


My ImageView is displaying an image of a chess style board for a little game I'm making. It is covered by a GridView that displays the images of my pieces. I have it displaying underneath but it is not positioned properly. I want it to match exactly the edges of the GridView but don't know how. Is there some way to make the GridView a "parent" of the ImageView so then I could say "match_parent" in the XML for it's height and width and so on?


Here is a screen of how my app looks now. I want the ugly colored grid I made to line up with the GridView images so that the black squares around the edge of my pieces are centered in the squares of the board.


enter image description here


Here is my XML:



xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/textFieldFU"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/gridview"
android:layout_alignTop="@+id/gridview"
android:layout_centerHorizontal="true" />

android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="600dp"
android:gravity="center"
android:horizontalSpacing="0dp"
android:numColumns="8"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />


Here is the relevant part of my MainActivity:



@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

final ImageAdapter iA = new ImageAdapter(this);

final ImageView board;
board = (ImageView) findViewById(R.id.imageView1);
board.setImageResource(R.drawable.board1);


GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(iA);
...


And here is the relevant parts of my ImageAdapter that I have which sets up the GridView:



public class ImageAdapter extends BaseAdapter {

public static int[] images = { R.drawable.rock2, R.drawable.paper2,
R.drawable.scissors2, R.drawable.rock2, R.drawable.paper2,
...//This part goes on for a while...
...//On to the relevant part...
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView iv;
if (convertView != null) {
iv = (ImageView) convertView;
} else {
iv = new ImageView(context);
iv.setLayoutParams(new GridView.LayoutParams(60, 60));
iv.setScaleType(ScaleType.CENTER);
iv.setPadding(0, 0, 0, 0);
}
iv.setImageResource(images[position]);
return iv;
}

public static int[] getImagesArray() {
return images;
}

public void setImagesArray(int[] newImages) {
images = newImages;
}


.

stackoverflow.comm

[General] MMS over WiFi

PLEASE, when asking for help provide as much information as possible. Otherwise, it's like calling your doctor and saying "My head hurts." Your doctor can't treat you unless he knows whether you have a headache or a concussion, and we can't help unless we know what the symptoms are and what you did before they occurred.


Have a Galaxy S3? Click here ==> Everything you wanted to know about your Galaxy S3

New to Android Central? Click here ==>http://forums.androidcentral.com/int...tart-here.html


.

forum.xda-developers.com

[General] Issues with Music Playlists on SD card


So I loaded a few playlists onto my SD card (through Media Monkey desktop app) the other day. Google music app found the playlists on the SD card and things were great...for one day. The next day, suddenly, the playlists disappeared. Most of the music was still "there" in the app, but some of it was missing (along with all of the playlists). I cleared the Google Music cache and everything with no luck. I've had other issues with the app before, so I figured I'd try something else. I downloaded a few other music player apps (Vanilla Music, Media Monkey, etc), but they aren't finding the playlists either. What is going on? What is the best way to add playlists from a windows computer to my SD card (ie what format should the playlist be in, best desktop apps to use, etc)? Also, any recommendations for solid (preferably free) music player apps on Android?



.

forum.xda-developers.com

[android help] How to use custom font in android xml?


The best way i found by googling is- Say if you want to use in TextView then we have to extend the Textview and have to set the font in that later we can use our customised Textview in our xml. I'll show the extended TextView below



package com.vins.android.widget.digi;

import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;

public class MyTextView extends TextView {

public MyTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}

public MyTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

public MyTextView(Context context) {
super(context);
init();
}

private void init() {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(),
"your_font.ttf");
setTypeface(tf);
}

}


We calling init() to set font in each of the costructors. Later we have to use this in our main.xml as shown below.



android:id="@+id/txt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="1"
android:text="This is a text view with the font u had set in MyTextView class "
android:textSize="30dip"
android:textColor="#ff0000"
>


.

stackoverflow.comm

[android help] MonoTouch Android Texting/Email


Monotouch Texting and Email is not documented for Android but for iOS it is, Does anyone know where the code is documented or could tell me? Thank you!



.

stackoverflow.comm

[android help] How to relate db entries with listview items

android - How to relate db entries with listview items - 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'll explain shortly what I am trying to do. I have a custom listView which is filled in with the data from SQLite database. Once a list item is longclicked, it is added to favourites: I have a separate column in the database, where "1" is assigned for entries added to favourites. Everything is ok by this point.


What I want to do now is to mark favourite list items with stars. I want to make a query to db like SELECT text (id?) FROM info WHERE favourite = 1 and place a star near the corresponding list item. The problem is I don't know how to call the specific list item (checkbox?) by its position (or text?) and mark it as selected. How can I achieve that?



















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










lang-sql






.

stackoverflow.comm

[android help] android - delete a row in sql and item in listview


i try to delete a row from my db. I'm using this method:


public void deletePlayerbyID(int id){mDb.delete(SQLITE_TABLE, KEY_ROWID +"="+id, null); }


called in activity :



listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView av, View v, int pos, long id) {
return onLongListItemClick(v,pos,id);
}
protected boolean onLongListItemClick(View v, final int pos, long id) {

AlertDialog.Builder builder = new AlertDialog.Builder(AndroidListViewCursorAdaptorActivity.this);
builder.setMessage("Are you sure to delete?").setCancelable(false).setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {bdHelper.open();
dbHelper.deletePlayerbyID(pos);
Log.i("ListView", "onLongListItemClick id=" + pos);
displayListView();
}
})


...........


why i can't delete the selected row from listView? i have a method that delete all db and it work.



.

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...