My Activity which displays the GridView crashes whenever I try to open the said Activity. I'm kind of clueless as to what's wrong with my codes, please help me regarding this.
public class AppContainerActivity extends Activity {
private PackageManager manager;
public List<AppDetails> apps;
GridView AppDrawer;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app_container);
AppDrawer = (GridView) findViewById(R.id.AppDrawer);
AppDrawer.setAdapter(new ItemAdapter(this, apps));
}
//Fetch installed apps on device
public void loadApps(){
manager = getPackageManager();
apps = new ArrayList<AppDetails>();
Intent getApp = new Intent(Intent.ACTION_MAIN,null);
getApp.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> availableActivities = manager.queryIntentActivities(getApp, 0);
for(ResolveInfo ri : availableActivities){
AppDetails app = new AppDetails();
app.appIcon = ri.activityInfo.loadIcon(manager);
apps.add(app);
}
}
}
ItemAdapter:
class ItemAdapter extends BaseAdapter {
Context mContext;
Integer[] icon;
ItemAdapter(Context c, List<AppDetails> apps){
mContext = c;
icon = apps.toArray(new Integer[apps.size()]);
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return icon.length;
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ImageView appIcon;
if(convertView == null) {
appIcon = new ImageView(mContext);
appIcon.setLayoutParams(new GridView.LayoutParams(85, 85));
appIcon.setScaleType(ImageView.ScaleType.CENTER_CROP);
appIcon.setPadding(8, 8, 8, 8);
} else {
appIcon = (ImageView) convertView;
}
appIcon.setImageResource(icon[position]);
return appIcon;
}
}
AppDetails:
class AppDetails {
Drawable appIcon;
}
XML layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<GridView
android:id="#+id/AppDrawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="auto_fit"
android:columnWidth="70dp"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:scrollbars="horizontal"
android:stretchMode="spacingWidthUniform"
/>
</LinearLayout>
You passed an uninitialized Arraylist into the adapter, so it's null and throwing an error in the constructor when you get the size of the list
You should call the loadApps method before you set the adapter. Or make that return the arraylist, and pass that method to the adapter.
Additionally worth mentioning, you can extend an ArrayAdapter<AppDetails>instead of a BaseAdapter, or you should complete the implementation of the BaseAdapter with the getItem method not returning null. In case you do later want to access elements of the adapter.
You also could keep the arraylist in the adapter. No need to convert to an array
Related
Actually i was trying JSON parsing example and the data which is parsed but not displaying in the listview.In the logcat the data is coming ,but it is not displaying in list.
I was running using an emulator. I am not able to find the mistake.Can anyone help?
Code below shows the custom list adapter.
public class ListAdapter extends BaseAdapter{
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String,String>>();
Context context;
public ListAdapter(ArrayList<HashMap<String, String>> list,
Context context) {
Log.i("ListAdapter", "ListAdapter");
this.list = list;
this.context = context;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
Log.i("ListAdapter", "getView");
if(convertView == null){
convertView = LayoutInflater.from(context).inflate(R.layout.list, null);
}
HashMap<String, String> hashmap = new HashMap<String, String>();
TextView trank = null,tcountry = null,tpopulation = null;
ImageView image;
trank = (TextView) convertView.findViewById(R.id.rank);
tcountry = (TextView) convertView.findViewById(R.id.country);
tpopulation = (TextView) convertView.findViewById(R.id.population);
image = (ImageView) convertView.findViewById(R.id.flag);
hashmap = list.get(position);
Log.i("list", ""+list.get(position) + "hashmp " + hashmap + hashmap.get("rank"));
String rank = hashmap.get("rank").toString();
String country = hashmap.get("country").toString();
String population = hashmap.get("population").toString();
String image_url = hashmap.get("flag");
Log.i("ListAdapter", ""+rank + " "+ country + " " +population );
trank.setText(rank);
tcountry.setText(country);
tpopulation.setText(population);
return convertView;
}
}
Main activity class
public class MainActivity extends Activity {
TextView webpage,trank,tcountry,tpopulation;
ListView lv;
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String,String>>();
String RANK = "rank";
String COUNTRY = "country";
String POPULATION = "population";
String FLAG = "flag";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv = (ListView) findViewById(R.id.listview);
trank = (TextView) findViewById(R.id.rank);
tcountry = (TextView) findViewById(R.id.country);
tpopulation = (TextView) findViewById(R.id.population);
webpage = (TextView) findViewById(R.id.webpage);
webpage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
String data = getDataFromWebPage();
list = parseDataFromWeb(data);
ListAdapter adapter = new ListAdapter(list, getApplicationContext());
lv.setAdapter(adapter);
}
});
}
custom list layout file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:id="#+id/rank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="rank"
/>
<TextView
android:id="#+id/country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="country"
/>
<TextView
android:id="#+id/population"
android:text="population"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<ImageView
android:id="#+id/flag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
I got solution, actually problem was with this layout file.When i removed the inner LinearLayout problem is solved.
Previously it was displayed like this after pressing the textview
But still i dont know why this layout file with inner LinearLayout doesnt work.
Make change in your code here :
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
You should return position in getItem() method:
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
you have to change:
ListAdapter adapter = new ListAdapter(getApplicationContext(),list);
try this
ListAdapter adapter = new ListAdapter( MainActivity.this,list);
lv.setAdapter(adapter);
Issue was with the custom list layout.Because of the inner linear layout data was not displaying.After removing the inner layout ,it worked
Is there any way to remove selected item from gridview.
I want to delete the selected item from my gridview.
I did not find any thing . my code is
public class ImageAdapter extends BaseAdapter{
Context context;
public ImageAdapter(Context context)
{
this.context = context;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return mThumbIds.length;
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return 0;
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
final ImageView imageView;
if (convertView == null) { // if it's not recycled, initialize some attributes
imageView = new ImageView(context);
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(0, 5, 0, 0);
} else {
imageView = (ImageView) convertView;
}
imageView.setImageResource(mThumbIds[position]);
return imageView;
}
public Integer[] mThumbIds = {
R.drawable.sample_1,R.drawable.sample_2,R.drawable.sample_3,
R.drawable.sample_3,R.drawable.sample_1,R.drawable.sample_2,
R.drawable.sample_2,R.drawable.sample_3,R.drawable.sample_1
};
}
//////////////////
public class ImageActivity extends Activity {
ImageAdapter iAdapter;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image);
iAdapter = new ImageAdapter(this);
final GridView gView = (GridView)findViewById(R.id.grid_view);
gView.setAdapter(iAdapter);
gView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
//gView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
// gView.setItemChecked(position, true);
Toast.makeText(ImageActivity.this, "" + position, Toast.LENGTH_SHORT).show();
}
});
iAdapter.notifyDataSetChanged();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_image, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.menu_delete)
{
Toast.makeText(this, "Delete",Toast.LENGTH_SHORT ).show();
}
return super.onOptionsItemSelected(item);
}
}
can anyone have idea .
thank
you are using a table :
public Integer[] mThumbIds = {
R.drawable.sample_1,R.drawable.sample_2,R.drawable.sample_3,
R.drawable.sample_3,R.drawable.sample_1,R.drawable.sample_2,
R.drawable.sample_2,R.drawable.sample_3,R.drawable.sample_1}
Tables are not modifiable.
Replace it by a List on which you will be able to make add or remove operations. Simply call notifyDataSetChanged when a change is made to let the adapter know that its list has been modified.
As Teovald and pskink suggested, you cannot have a fixed list of images and then implement the remove functionality that you are looking for. If you want to add remove, change your design and make sure your data set is also removable. What you have tried so far seems to be using some really basic code which is good to show basic GridView feature.
Just try this. Create a image data set class which returns the actual images. Store the images in a List that can be modified. Add setters/getters to this data set and also add a method to delete a particular item. Change your image adapter to use the image from this new data set. Whenever an image is deleted, call the notifyDataSetChanged on the adpater.
Good luck
I am writing an android app, and I am having trouble getting a row's position in ListView with CheckBox.
Here is a screenshot on the emulator:
I already made the ListView with CheckBoxes. But I can't figure out how find the row's position for each checked entry. And once I get the checked positions, I want to implement a Remove Selected action.
Please help!
Here is my code:
public class ListTest extends ListActivity implements OnCheckedChangeListener {
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//--- Importing StringsArray---
Bundle gotBasketScanner = getIntent().getExtras();
String[] StringArrayHistory = gotBasketScanner.getStringArray("fromHistory");
// ---Make Adapter---
setListAdapter( new ArrayAdapter<String>(ListTest.this,
android.R.layout.simple_list_item_multiple_choice,
StringArrayHistory));
// ---Put Array into a ListView and add Checkboxes to Listview
ListView list = getListView();
list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
}
hey check this it will help you...
http://windrealm.org/tutorials/android/listview-with-checkboxes-without-listactivity.php
Android ListView with Checkbox and all clickable
http://appfulcrum.com/2010/09/12/listview-example-3-simple-multiple-selection-checkboxes/
Use onItemClick() in instead of onCheckedChangeListener...
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Toast.makeText(getApplicationContext(), "Item "+position+" is clicked",
Toast.LENGTH_SHORT).show();
}
}
This is the better way to get the clicked position and id.
I hope this will solve your problem.
EDIT
I have updated the following line:-
getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
now try ur code.
You can use PrefrenceScreen with CheckBoxPreference for easier and scalellable implementation
You can use CheckedTextView to implement the same:
main.xml
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:checkMark="?android:attr/listChoiceIndicatorMultiple">
</CheckedTextView>
addlist.xml
<?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" >
<ListView
android:id="#+id/mainListView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
</ListView>
<Button android:id="#+id/click"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Click"/>
</LinearLayout>
And here is the activity GetCheckedTextPositionActivity. On click of the button you will get the positions of the listitem checked :
public class GetCheckedTextPositionActivity extends Activity {
private ListView myList;
private EfficientAdapter myAdapter;
private ArrayList<String> data;
private LayoutInflater mInflater;
private Button click;
private ArrayList<Integer> positions;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.addlist);
positions = new ArrayList<Integer>();
data = new ArrayList<String>();
data.add("Bangalore");
data.add("Delhi");
data.add("Patna");
data.add("Mumbai");
click = (Button)findViewById(R.id.click);
mInflater = LayoutInflater.from(getApplicationContext());
myList = (ListView) findViewById(R.id.mainListView);
myAdapter = new EfficientAdapter(data, getApplicationContext());
myList.setAdapter(myAdapter);
click.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
if(positions.size() != 0){
for(Integer pos : positions){
Log.e("Positions checked :"," Positions :"+pos);
}
}
}
});
}
public class EfficientAdapter extends BaseAdapter {
private ArrayList<String> myData;
public EfficientAdapter(ArrayList<String> mData, Context ctx) {
// TODO Auto-generated constructor stub
this.myData = mData;
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return myData.size();
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return myData.get(position);
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
final int currentPos = position;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.main, null);
}
((CheckedTextView) convertView).setText(myData.get(position));
((CheckedTextView) convertView).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
((CheckedTextView) v).toggle();
if(((CheckedTextView) v).isChecked()){
positions.add(currentPos);
}
}
});
return convertView;
}
}
}
Hope this helps.
I have an xml with one textveiw and one edittext in it .I used this xml to get different rows in the list view of another xml file to list the data in that page.
The xml file that is used to list data in listview is as given below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="2dip"
android:paddingBottom="0dip">
<TextView
android:id="#+id/tv_Sort_Address"
android:layout_width="0dip"
style="#style/ListTextViewStyle"
android:layout_height="wrap_content"
android:text="No"
android:layout_weight="2"/>
<EditText
android:textColor="#000000"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:inputType="number"
style="#style/EditTextStyle"
android:background="#android:drawable/editbox_background"
android:id="#+id/et_Sort_Order"
android:layout_weight="1">
</EditText>
</LinearLayout>
I filled the Listview with data on another xml fils as given below
simpleAdapter = new SimpleAdapter(this, alist,
R.layout.sort_order_list_row, new String[] { "Sort_Address",
"Sort_FKDeliveryStatus", "Sort_PKDelivery",
"Sort_DeliveryOrder" }, new int[] {
R.id.tv_Sort_Address, R.id.tv_Sort_FKDeliveryStatus,
R.id.tv_Sort_PKDelivery, R.id.et_Sort_Order });
listSortOrder.setAdapter(simpleAdapter);
The problem with me is that if i have two row in the listview and when i
placed a value in one of edit text row and move on to the another rows edit text the value placed in the first row got disappered.
<ListView android:id="#+id/lv_Sort_Order"
style="#style/ListTextBackGround"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dip"
android:descendantFocusability="afterDescendants"
android:layout_marginRight="5dip" >
</ListView>
to solve this I placed android:descendantFocusability="afterDescendants" in the list view page to get focus on to the merged page. But it didn't solve the problem. Will anyone help me please.
Is there any property I need to be placed in the list view or in the merged Page?
Use this code :
public class ListViewDemo extends Activity {
private ListView listViewScore = null;
private ListViewAdapter listViewAdapter = null;
private String[] usernameArr = null;
private String[] scoreArr = null;
//ArrayList<String> usernameArrLst = null ,scoreArrLst = null;
//private Helper helper = null;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
listViewScore=(ListView)findViewById(R.id.listViewScore);
usernameArr = new String[]{"Alan","Bob","Carl","Doaniel","Evan","Fred","Gram"};
scoreArr = new String[usernameArr.length];
//usernameArrLst = new ArrayList<String>(Arrays.asList(usernameArr));
//scoreArrLst = new ArrayList<String>(Arrays.asList(scoreArr));
listViewAdapter = new ListViewAdapter();
listViewScore.setAdapter(listViewAdapter);
}
class ListViewAdapter extends BaseAdapter{
#Override
public int getCount() {
// TODO Auto-generated method stub
if(usernameArr==null){
return 0;
}
return usernameArr.length;
}
#Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return usernameArr[position];
}
#Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
#Override
public View getView(int position, View view, ViewGroup parent) {
// TODO Auto-generated method stub
final ViewHolder viewHolder ;
View rowView=view;
if(rowView==null){
LayoutInflater layoutinflate =LayoutInflater.from(ListViewDemo.this);
rowView=layoutinflate.inflate(R.layout.listviewnewtext, parent, false);
viewHolder = new ViewHolder();
viewHolder.tv_Sort_Address = (TextView)rowView.findViewById(R.id.tv_Sort_Address);
viewHolder.et_Sort_Order = (EditText)rowView.findViewById(R.id.et_Sort_Order);
viewHolder.et_Sort_Order.addTextChangedListener(new TextWatcher() {
#Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
#Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
#Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
scoreArr[viewHolder.ref] = s.toString();
}
});
rowView.setTag(viewHolder);
}else{
viewHolder = (ViewHolder) rowView.getTag();
}
viewHolder.ref = position;
viewHolder.tv_Sort_Address.setText(usernameArr[position]);
viewHolder.et_Sort_Order.setText(scoreArr[position]);
return rowView;
}
}//class ends
class ViewHolder{
TextView tv_Sort_Address;
EditText et_Sort_Order;
int ref;
}
}
Is there any reason why you use SimpleAdapter? Can you try using ArrayAdapter or BaseAdapter.
Check this and any BaseAdapter example.
Iam trying to create a list view dynamically, Please provide me an example for list view in android...
Activity class......
public class UsersListActivity extends ListActivity{
RegisterUser registerUser;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] statesList = getListOfAllUsers();
Toast.makeText(getApplicationContext(),
"States Array lentgh is : " + statesList.length,
Toast.LENGTH_LONG).show();
setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item,
statesList));
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(getApplicationContext(),
"You selected : "+((TextView) view).getText(), Toast.LENGTH_SHORT).show();
}
});
}}
and create an xml file named list_item.xml and paste the below code.
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp" android:textColor="#ffffff" android:textStyle="bold" android:background="#drawable/border_cell">
</TextView>
You can create your own List View by extending Base adapter class
public class ListAdapterDroidman extends BaseAdapter{
private ArrayList<ListitemDroidman> list = new ArrayList<ListitemDroidman>();
#SuppressWarnings("unused")
private Context context;
public ListAdapterDroidman(Context context) {
this.context = context;
}
public void addItem(ListitemDroidman item) {
list.add(item);
}
public void addItem(ListitemDroidman item,int pos)
{
list.add(pos, item);
}
public void removeItem(int pos)
{
list.remove(pos);
}
public void clearList()
{
list.clear();
}
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
public Object getItem(int position) {
// TODO Auto-generated method stub
return list.get(position);
}
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
return list.get(position);
}
}
Then create your own layout
public class ListitemDroidman extends LinearLayout {
TextView filename;
ImageView iv;
public ListitemDroidman(Context context) {
super(context);
}
public void setInfo(Context context, Bitmap icon, String fname,int colorId) {
iv=new ImageView(context);
iv.setImageBitmap(icon);
iv.setPadding(0, 0, 20, 0);
addView(iv);
filename = new TextView(context);
filename.setTextSize(20);
filename.setTextColor(getResources().getColor(colorId));
filename.setText(fname);
addView(filename);
}
}
Now create listitems in your activityClass
create object of the adapter that u have created
myListitem = new ListitemDroidman(this);
icon = BitmapFactory.decodeResource(getResources(),
R.drawable.folder_icon);
myListitem.setInfo(getApplicationContext(), icon, filelist[i],
R.color.color_white);
add the listitem to the adaper as in normal list
la_file.addItem(myListitem);
Try this tutorial to understand how to use ListView.
http://developer.android.com/resources/tutorials/views/hello-listview.html
Why don't you just take a look at the ApiDemos of your android SDK..
You can find 14 examples of ListActivities implementations..
Or just search here or on Google, you can find lots of examples
Then if you want to achieve something in particular you can ask a more specific question here, does it sound fair?