Search Results

Search found 25798 results on 1032 pages for 'android xml'.

Page 75/1032 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • XML Schema: Can I make some of an attribute's values be required but still allow other values?

    - by scrotty
    (Note: I cannot change structure of the XML I receive, I am only able to change how I validate it.) Let's say I can get XML like this: <Address Field="Street" Value="123 Main"/> <Address Field="StreetPartTwo" Value="Unit B"/> <Address Field="State" Value="CO"/> <Address Field="Zip" Value="80020"/> <Address Field="SomeOtherCrazyValue" Value="Foo"/> I need to create an XSD schema that validates that "Street", "State" and "Zip" must be present. But I don't care if "StreetPartTwo" or "SomeOTherCrazyValue" is present. If I knew that only the three I care about could be included, I could do this: <xs:element name="Address" type="addressType" maxOccurs="unbounded" minOccurs="3"/> <xs:complexType name="addressType"> <xs:attribute name="Field" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Street"/> <xs:enumeration value="State"/> <xs:enumeration value="Zip"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> But this won't work with my case because I may also receive those other Address elements (that also have "Field" attributes) that I don't care about. Any ideas how I can ensure the stuff I care about is present but let the other stuff in too? TIA! Sean

    Read the article

  • Advance: Parsing XML into another XML page using only javascript or jquery; Can't use PhP, Java or MySQL

    - by UrBestFriend
    Current site: http://cardwall.tk/ Example of intended outcome: http://www.shockwave.com/downloadWall.jsp I have an embeded flash object that uses XML/RSS (Picasa) to feed itself pictures. Now I created my own XML/RSS feed so that I can add additional XML tags and values. Now here's my big problem: enabling search. Since I'm not relying on Picasa's API anymore to return custom RSS/XML for the user's search, how can I create xml from another xml based on the user's search queries using only JavaScript and Jquery? Here is the current code: <script type="text/javascript"> var flashvars = { feed : "http%3A%2F%2Frssfeed.ucoz.com%2Frssfeed.xml", backgroundColor : "#FFFFFF", metadataFont : "Arial", wmode : "opaque", iFrameScrolling: "no", numRows : "3", }; var params = { allowFullScreen: "true", allowscriptaccess : "always", wmode: "opaque" }; swfobject.embedSWF("http://apps.cooliris.com/embed/cooliris.swf", "gamewall", "810", "410", "9.0.0", "", flashvars, params); $(document).ready(function() { $("#cooliris input").keydown(function(e) { if(e.keyCode == 13) { $("#cooliris a#searchCooliris").click(); return false; } }); doCoolIrisSearch = function() { cooliris.embed.setFeedContents( '** JAVA STRING OF PARSED RSS/XML based on http%3A%2F%2Frssfeed.ucoz.com%2Frssfeed.xml and USER'S SEARCH INPUT** ' ) }); <form id="searchForm" name="searchForm" class="shockwave"> <input type="text" name="coolIrisSearch" id="coolIrisSearch" value="Search..." class="field text short" onfocus="this.value='';" /> <a id="searchCooliris" href="#" onclick="doCoolIrisSearch();return false;" class="clearLink">Search Cooliris</a> </form> <div id="gamewall"></div> So basically, I want to replace cooliris.embed.setFeedContents's value with a Javastring based on the parsed RSS/XML and user search input. Any code or ideas would be greatly appreciated.

    Read the article

  • Android Set up Question - Which API Level do I Install?

    - by Greg
    Hi all, I'm trying to set up the Android SDK on Ubuntu. Someday I want to make apps that can reach most of the market. I've heard I need to make the apps compatible with Android 1.6 for this. Does that mean everything I install should be for Android 1.6 (API level 4?). Will I have any trouble running the apps on my phone with is Android 2.1?

    Read the article

  • I have problem loading all items from XML with for each

    - by vaha
    Hi all, I'm low level as3 programmer and I need help whit this code: I have gallery XML file: 1 0 Lokacije 1 1.jpg 2 2 Coaching 1 2.jpg 3 0 0 3.jpg And: var loader: URLLoader = new URLLoader(); loader.load(new URLRequest("gallery.xml"); var xml = new XML(evt.target.data); for each(var item in xml..item) { centralniText.htmlText = item.slika; } only shows last item from XML file: 3.jpg I want all. Please help.

    Read the article

  • Why can't I start XML entity names with 'xml''?

    - by flamey
    <XmlInfo /> I ran into problem using Perl's popular SOAP::Lite module, where it wouldn't accept XML entity names starting with "xml" (regardles letters' case). The author of the module replied to email saying that entity names starting with "xml" are not permitted in XML specification, but I couldn't find it in W3C's documents for 1.0 and 1.1 specs, I also couldn't find it in any of the articles or guidelines docs about XML entity naming. In fact some guideline documents used names starting with xml as an example, and lots of people are using it, as I see via Google Code Search. So are there any restrictions (besides which characters to use as defined in W3C's documents) in Entity naming in XML? Is there a restriction saying you can't name entities starting with "xml"?

    Read the article

  • Progress dialog getting dismissed before the thread gets finished - Android

    - by user264953
    Hi experts, I use the code provided by Fedor in the following link, in order to get the latitude and longitude from my simple demo app. I am trying to fetch the latitude and longitude using the MyLocation class provided by him in that link. What is the simplest and most robust way to get the user's current location in Android? I try to fetch the latitude and longitude on a button click. On the button click, I start an async task and delegate the location fetching work to the do in background method of my asynctask. pre execute - progressdialog initiated. post execute - progress dialog dismissed. This is how, the progress dialog in my code should work and here is the issue which I have. THe progress dialog gets initiated correctly, but even before the latitude and longitude gets printed in the doinbackground method, the progress dialog gets dismissed. I do not understand why this happens. Here is my front end activity public class LocationServices extends Activity { MyLocation myLocation = new MyLocation(); LocationResult locationResult; TextView tv1, tv2; Location location; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv1 = (TextView) findViewById(R.id.tv1); tv2 = (TextView) findViewById(R.id.tv2); Button btn = (Button) findViewById(R.id.Button01); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { new LocationAsyncTasking().execute(); } }); } public class LocationAsyncTasking extends AsyncTask<String, Void, Void> { ProgressDialog dialog; int totalAvail; protected void onPreExecute() { // this.dialog.setMessage("Inserting data..."); dialog = new ProgressDialog(LocationServices.this); this.dialog.setMessage("Fetching data..."); this.dialog.show(); } protected Void doInBackground(String... args) { Looper.prepare(); locationResult = new LocationResult() { public void gotLocation(Location location) { // TODO Auto-generated method stub // LocationServices.this.location = location; System.out.println("Progress dialog should be present now - latitude"+location.getLatitude()); System.out.println("Progress dialog should be present now - longitude"+location.getLongitude()); } }; myLocation.getLocation(LocationServices.this, locationResult); return (null); } protected void onProgressUpdate(Integer... progress) { } protected void onPostExecute(Void unused) { dialog.dismiss(); } } } I am quite puzzled, thinking of what makes this progress dialog disappear even before the SOP in doinbackground is finished. Experts, please help me understand and resolve this issue. Any help in this regard is well appreciated. Looking forward, Best Regards, Rony

    Read the article

  • format an xml string in Ruby

    - by user1476512
    given an xml string like this : <some><nested><xml>value</xml></nested></some> what's the best option(using ruby) to format it readable like : <some> <nested> <xml>value</xml> </nested> </some> I've found an answer here: what's the best way to format an xml string in ruby?, which is really helpful. But it formats xml like: <some> <nested> <xml> value </xml> </nested> </some> As my xml string is a little big in length. So it is not readable in this format. Thanks in advance!

    Read the article

  • Why doesn't my text be bold when displaying on device screen

    - by john123
    My string.xml: <!--I try to bold my argument %s, like below:--> <string name="hello">Hello to: <b>%s</b> !</string> My layout main.xml: <LinearLayout ...> <TextView android:id="@+id/hello_txt" ... .../> </LinearLayout> My Fragment class: public class MyFragment extends Fragment{ TextView helloTxt; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); helloTxt = (TextView) findViewById(R.id.hello_txt); } @Override public void onStart() { super.onStart(); //pass "Monday" as the argument to my string helloTxt.setText(String.format(getString(R.string.hello), "Monday")); } } When I run my app on my device, I got "Hello to: Monday !" displaying on screen, but the "Monday" is not bold, but I used <b> in my string.xml. Why it is not bold??

    Read the article

  • Android Expandable List View Update

    - by Gaurav Arora
    I am implementing a chatting application, where I have made a service to listen all the presence changed. On the change of the presence I want to update the data and I am unable to update the data that is showing in the expandable list view. Please suggest me a means to do the same. public class UserMenuActivity extends ExpandableListActivity { private XMPPConnection connection; String name,availability,subscriptionStatus; TextView tv_Status; /** Variable Define here */ private String[] data = { "View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] data_Contact = { "Rename Category","Move Contact to Category", "View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] data_child_contact = { "Open chat", "Delete Contact","View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] menuItem = { "Chats", "Contacts", "CGM Groups", "Pending","Request" }; private List<String> menuItemList = Arrays.asList(menuItem); private int commonGroupPosition = 0; private String etAlertVal; private DatabaseHelper dbHelper; private int categoryID, listPos; /** New Code here.. */ private ArrayList<String> groupNames; private ArrayList<ArrayList<ChildItems>> childs; private UserMenuAdapter adapter; private Object object; private String[] data2 = { "PIN Michelle", "IP Call" }; private ListView mlist2; private ImageButton mimBtnMenu; private LinearLayout mllpopmenu; private View popupView; private PopupWindow popupWindow; private AlertDialog.Builder alert; private EditText input; private TextView mtvUserName, mtvUserTagLine; private ExpandableListView mExpandableListView; public static List<CategoryDataClass> categoryList; private boolean menuType = false; private String childValContact=""; public static Context context; @Override public void onBackPressed() { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); } else { if (CCMStaticVariable.CommonConnection.isConnected()) { CCMStaticVariable.CommonConnection.disconnect(); } super.onBackPressed(); } } @SuppressWarnings("unchecked") @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU) { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); } else { if (commonGroupPosition >= 4 && menuType == true) { if(childValContact == ""){ mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data_Contact)); }else{ mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data_child_contact)); } } else if (commonGroupPosition == 0) { mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data)); } } return true; } return super.onKeyDown(keyCode, event); } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.usermenulayout); dbHelper = new DatabaseHelper(UserMenuActivity.this); //this.context = context.getApplicationContext(); XMPPConn.getContactList(); connection = CCMStaticVariable.CommonConnection; Presence userPresence = new Presence(Presence.Type.available); userPresence.setPriority(24); userPresence.setMode(Presence.Mode.away); connection.sendPacket(userPresence); } @Override protected void onResume() { super.onResume(); Presence userPresence = new Presence(Presence.Type.available); userPresence.setPriority(24); userPresence.setMode(Presence.Mode.away); connection.sendPacket(userPresence); XMPPConn.getContactList(); setExpandableListView(); } public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { if (groupPosition == 1 && childPosition == 0) { startActivity(new Intent(UserMenuActivity.this, InvitetoCCMActivity.class)); } else if (groupPosition == 1 && childPosition != 0) { Intent intent = new Intent(UserMenuActivity.this, UserChatActivity.class); intent.putExtra("userNameVal", XMPPConn.mfriendList.get(childPosition - 1).friendName); startActivity(intent); } else if (groupPosition == 2 && childPosition == 0) { startActivity(new Intent(UserMenuActivity.this, CreateGroupActivity.class)); } else if (groupPosition == 2 && childPosition != 0) { String GROUP_NAME = childs.get(groupPosition).get(childPosition) .getName().toString(); int end = GROUP_NAME.indexOf("("); CCMStaticVariable.groupName = GROUP_NAME.substring(0, end).trim(); startActivity(new Intent(UserMenuActivity.this, GroupsActivity.class)); } else if (groupPosition >= 4) { childValContact = childs.get(groupPosition).get(childPosition).getName().trim(); showToast("user==>"+childValContact, 0); } return false; } private void setExpandableListView() { /***###############GROUP ARRAY ############################*/ final ArrayList<String> groupNames = new ArrayList<String>(); groupNames.add("Chats (2)"); groupNames.add("Contacts (" + XMPPConn.mfriendList.size() + ")"); groupNames.add("CGM Groups (" + XMPPConn.mGroupList.size() + ")"); groupNames.add("Pending (1)"); XMPPConn.getGroup(); categoryList = dbHelper.getAllCategory(); /**Group From Sever*/ if (XMPPConn.mGroupList.size() > 0) { for (int g = 0; g < XMPPConn.mGroupList.size(); g++) { XMPPConn.getGroupContact(XMPPConn.mGroupList.get(g).groupName); groupNames.add(XMPPConn.mGroupList.get(g).groupName + "(" + XMPPConn.mGroupContactList.size()+ ")"); } } if(categoryList.size() > 0){ for (int cat = 0; cat < categoryList.size(); cat++) { groupNames.add(categoryList.get(cat).getCategoryName()+ "(0)"); } } this.groupNames = groupNames; /*** ###########CHILD ARRAY * #################*/ ArrayList<ArrayList<ChildItems>> childs = new ArrayList<ArrayList<ChildItems>>(); ArrayList<ChildItems> child = new ArrayList<ChildItems>(); child.add(new ChildItems("Alisha", "Hi",0)); child.add(new ChildItems("Michelle", "Good Morning",0)); childs.add(child); child = new ArrayList<ChildItems>(); child.add(new ChildItems("", "",0)); if (XMPPConn.mfriendList.size() > 0) { for (int n = 0; n < XMPPConn.mfriendList.size(); n++) { child.add(new ChildItems(XMPPConn.mfriendList.get(n).friendNickName, XMPPConn.mfriendList.get(n).friendStatus, XMPPConn.mfriendList.get(n).friendState)); } } childs.add(child); /************** CGM Group Child here *********************/ child = new ArrayList<ChildItems>(); child.add(new ChildItems("", "",0)); if (XMPPConn.mGroupList.size() > 0) { for (int grop = 0; grop < XMPPConn.mGroupList.size(); grop++) { child.add(new ChildItems( XMPPConn.mGroupList.get(grop).groupName + " (" + XMPPConn.mGroupList.get(grop).groupUserCount + ")", "",0)); } } childs.add(child); child = new ArrayList<ChildItems>(); child.add(new ChildItems("Shuchi", "Pending (Waiting for Authorization)",0)); childs.add(child); /************************ Group Contact List *************************/ if (XMPPConn.mGroupList.size() > 0) { for (int g = 0; g < XMPPConn.mGroupList.size(); g++) { /** Contact List */ XMPPConn.getGroupContact(XMPPConn.mGroupList.get(g).groupName); child = new ArrayList<ChildItems>(); for (int con = 0; con < XMPPConn.mGroupContactList.size(); con++) { child.add(new ChildItems( XMPPConn.mGroupContactList.get(con).friendName, XMPPConn.mGroupContactList.get(con).friendStatus,0)); } childs.add(child); } } if(categoryList.size() > 0){ for (int cat = 0; cat < categoryList.size(); cat++) { child = new ArrayList<ChildItems>(); child.add(new ChildItems("-none-", "",0)); childs.add(child); } } this.childs = childs; /** Set Adapter here */ adapter = new UserMenuAdapter(this, groupNames, childs); setListAdapter(adapter); object = this; mlist2 = (ListView) findViewById(R.id.list2); mimBtnMenu = (ImageButton) findViewById(R.id.imBtnMenu); mllpopmenu = (LinearLayout) findViewById(R.id.llpopmenu); mtvUserName = (TextView) findViewById(R.id.tvUserName); mtvUserTagLine = (TextView) findViewById(R.id.tvUserTagLine); //Set User name.. System.out.println("CCMStaticVariable.loginUserName===" + CCMStaticVariable.loginUserName); if (!CCMStaticVariable.loginUserName.equalsIgnoreCase("")) { mtvUserName.setText("" + CCMStaticVariable.loginUserName); } /** Expandable List set here.. */ mExpandableListView = (ExpandableListView) this .findViewById(android.R.id.list); mExpandableListView.setOnGroupClickListener(new OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { XMPPConn.getContactList(); if (parent.isGroupExpanded(groupPosition)) { commonGroupPosition = 0; }else{ commonGroupPosition = groupPosition; } String GROUP_NAME = groupNames.get(groupPosition); int end = groupNames.get(groupPosition).indexOf("("); String GROUP_NAME_VALUE = GROUP_NAME.substring(0, end).trim(); if (menuItemList.contains(GROUP_NAME_VALUE)) { menuType = false; CCMStaticVariable.groupCatName = GROUP_NAME_VALUE; } else { menuType = true; CCMStaticVariable.groupCatName = GROUP_NAME_VALUE; } long findCatId = dbHelper.getCategoryID(GROUP_NAME_VALUE); if (findCatId != 0) { categoryID = (int) findCatId; } childValContact=""; showToast("Clicked on==" + GROUP_NAME_VALUE, 0); return false; } }); /** Click on item */ mlist2.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int pos,long arg3) { if (commonGroupPosition >= 4) { if(childValContact == ""){ if (pos == 0) { showAlertEdit(CCMStaticVariable.groupCatName); } /** Move contact to catgory */ if (pos == 1) { startActivity(new Intent(UserMenuActivity.this,AddContactCategoryActivity.class)); } }else{ if(pos == 0){ Intent intent = new Intent(UserMenuActivity.this,UserChatActivity.class); intent.putExtra("userNameVal",childValContact); startActivity(intent); } if(pos == 1){ XMPPConn.removeEntry(childValContact); showToast("Contact deleted sucessfully", 0); Intent intent = new Intent(UserMenuActivity.this,UserMenuActivity.class); } } } else { /** MyProfile */ if (pos == 0) { startActivity(new Intent(UserMenuActivity.this, MyProfileActivity.class)); } /** New multiperson chat start */ if (pos == 1) { startActivity(new Intent(UserMenuActivity.this, NewMultipersonChatActivity.class)); } /** New Broadcast message */ if (pos == 2) { startActivity(new Intent(UserMenuActivity.this, NewBroadcastMessageActivity.class)); } /** Click on add category */ if (pos == 3) { showAlertAdd(); } if (pos == 4) { startActivity(new Intent(UserMenuActivity.this, CreateGroupActivity.class)); } if (pos == 5) { startActivity(new Intent(UserMenuActivity.this, InvitetoCCMActivity.class)); } if (pos == 6) { startActivity(new Intent(UserMenuActivity.this, SearchActivity.class)); } if (pos == 7) { onGroupExpand(2); for (int i = 0; i < groupNames.size(); i++) { mExpandableListView.expandGroup(i); } } /** Click on settings */ if (pos == 8) { startActivity(new Intent(UserMenuActivity.this, SettingsActivity.class)); } if (pos == 10) { System.exit(0); } if (pos == 14) { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); if (popupWindow.isShowing()) { popupWindow.dismiss(); } } else { mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter( UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data)); } } } } }); } /** Toast message display here.. */ private void showToast(String msg, int time) { Toast.makeText(this, msg, time).show(); } public String showSubscriptionStatus(String friend){ return friend; } } Service.class public class UpdaterService extends Service { private XMPPConnection connection; String Friend; String user = ""; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { // Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show(); super.onCreate(); } @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Override public void onStart(Intent intent, int startId) { // TODO Auto-generated method stub showToast("My Service Started", 0); connection = getConnection(); if (connection.isConnected()) { final Roster roster = connection.getRoster(); RosterListener r1 = new RosterListener() { @Override public void presenceChanged(Presence presence) { // TODO Auto-generated method stub XMPPConn.getContactList(); } @Override public void entriesUpdated(Collection<String> arg0) { // TODO Auto-generated method stub //notification("entriesUpdated"); } @Override public void entriesDeleted(Collection<String> arg0) { // TODO Auto-generated method stub //notification("entriesDeleted"); } @Override public void entriesAdded(Collection<String> arg0) { // TODO Auto-generated method stub Iterator<String> it = arg0.iterator(); if (it.hasNext()) { user = it.next(); } RosterEntry entry = roster.getEntry(user); if(entry.getType().toString().equalsIgnoreCase("to")){ int index_of_Alpha = Friend.indexOf("@"); String subID = Friend.substring(0, index_of_Alpha); notification("Hi "+subID+" wants to add you"); } } }; if (roster != null) { roster.setSubscriptionMode(Roster.SubscriptionMode.manual); System.out.println("subscription going on"); roster.addRosterListener(r1); } } else { showToast("Connection lost-", 0); } } protected void showToast(String msg, int time) { Toast.makeText(this, msg, time).show(); } private XMPPConnection getConnection() { return CCMStaticVariable.CommonConnection; } /** Notification manager */ private void notification(CharSequence message) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); int icon = R.drawable.ic_launcher; CharSequence tickerText = message; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); Context context = getApplicationContext(); CharSequence contentTitle = "CCM"; CharSequence contentText = message; Intent notificationIntent = new Intent(this, ManageNotification.class); notificationIntent.putExtra("Subscriber_ID",user ); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); notification.flags |= Notification.FLAG_AUTO_CANCEL; final int HELLO_ID = 1; mNotificationManager.notify(HELLO_ID, notification); } } Here is my adapter class public class UserMenuAdapter extends BaseExpandableListAdapter { private ArrayList<String> groups; private ArrayList<ArrayList<ChildItems>> childs; private Context context; public LayoutInflater inflater; ImageView img_availabiliy; private static final int[] EMPTY_STATE_SET = {}; private static final int[] GROUP_EXPANDED_STATE_SET = {android.R.attr.state_expanded}; private static final int[][] GROUP_STATE_SETS = { EMPTY_STATE_SET, // 0 GROUP_EXPANDED_STATE_SET // 1 }; public UserMenuAdapter(Context context, ArrayList<String> groups, ArrayList<ArrayList<ChildItems>> childs) { this.context = context; this.groups = groups; this.childs = childs; inflater = LayoutInflater.from(context); } @Override public Object getChild(int groupPosition, int childPosition) { return childs.get(groupPosition).get(childPosition); } @Override public long getChildId(int groupPosition, int childPosition) { return (long) (groupPosition * 1024 + childPosition); } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View v = null; if (convertView != null) v = convertView; else v = inflater.inflate(R.layout.child_layout, parent, false); ChildItems ci = (ChildItems) getChild(groupPosition, childPosition); TextView tv = (TextView) v.findViewById(R.id.tvChild); tv.setText(ci.getName()); TextView tv2 = (TextView) v.findViewById(R.id.tvChild2); tv2.setText(ci.getDailyStatus()); img_availabiliy = (ImageView)v.findViewById(R.id.img_childlayout_AVAILABILITY); ImageView friendPics = (ImageView)v.findViewById(R.id.ivFriendPics); if(ci.getStatusState() == 1){ img_availabiliy.setImageResource(R.drawable.online); } else if(ci.getStatusState()==0){ img_availabiliy.setImageResource(R.drawable.offline); } else if (ci.getStatusState()==2) { img_availabiliy.setImageResource(R.drawable.away); } else if(ci.getStatusState()==3){ img_availabiliy.setImageResource(R.drawable.busy); } else{ img_availabiliy.setImageDrawable(null); } if((groupPosition == 1 && childPosition == 0)){ friendPics.setImageResource(R.drawable.inviteto_ccm); img_availabiliy.setVisibility(View.INVISIBLE); } else if(groupPosition == 2 && childPosition == 0){ friendPics.setImageResource(R.drawable.new_ccmgroup); img_availabiliy.setVisibility(View.VISIBLE); }else{ if(ci.getPicture()!= null){ Bitmap bitmap = BitmapFactory.decodeByteArray(ci.getPicture(), 0, ci.getPicture().length); bitmap = Bitmap.createScaledBitmap(bitmap, 50, 50, true); friendPics.setImageBitmap(bitmap); }else{ friendPics.setImageResource(R.drawable.avatar); } img_availabiliy.setVisibility(View.VISIBLE); } return v; } @Override public int getChildrenCount(int groupPosition) { return childs.get(groupPosition).size(); } @Override public Object getGroup(int groupPosition) { return groups.get(groupPosition); } @Override public int getGroupCount() { return groups.size(); } @Override public long getGroupId(int groupPosition) { return (long) (groupPosition * 1024); } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View v = null; if (convertView != null) v = convertView; else v = inflater.inflate(R.layout.group_layout, parent, false); String gt = (String) getGroup(groupPosition); TextView tv2 = (TextView) v.findViewById(R.id.tvGroup); if (gt != null) tv2.setText(gt); /**Set Image on group layout, Max/min*/ View ind = v.findViewById( R.id.explist_indicator); View groupInd = v.findViewById( R.id.llgroup); if( ind != null ) { ImageView indicator = (ImageView)ind; if( getChildrenCount( groupPosition ) == 0 ) { indicator.setVisibility( View.INVISIBLE ); } else { indicator.setVisibility( View.VISIBLE ); int stateSetIndex = ( isExpanded ? 1 : 0) ; Drawable drawable = indicator.getDrawable(); drawable.setState(GROUP_STATE_SETS[stateSetIndex]); } } if( groupInd != null ) { RelativeLayout indicator2 = (RelativeLayout)groupInd; if( getChildrenCount( groupPosition ) == 0 ) { indicator2.setVisibility( View.INVISIBLE ); } else { indicator2.setVisibility( View.VISIBLE ); int stateSetIndex = ( isExpanded ? 1 : 0) ; Drawable drawable2 = indicator2.getBackground(); drawable2.setState(GROUP_STATE_SETS[stateSetIndex]); } } return v; } @Override public boolean hasStableIds() { return true; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } public void onGroupCollapsed(int groupPosition) { } public void onGroupExpanded(int groupPosition) { } } I just want to update my list in ON PRESENCE CHANGED method in the Service class.. Please suggest me a means to do the same.

    Read the article

  • Oracle 10.1 and 11.2 produce different XML using the same statement

    - by MindFyer
    I am migrating a database from Oracle 10.1 to 11.2 and I have the following problem. The statement SELECT '<?xml version="1.0" encoding="utf-8" ?>' || (Xml).getClobVal() AS XmlClob FROM ( SELECT XmlElement( "Element1", ( SELECT XmlAgg(tpx.Xml) FROM ( SELECT XmlElement("Element3",XmlForest('content' as Element4)) AS Xml FROM dual ) tpx ) AS "Element2" ) AS Xml FROM dual ) On the original 10.1 database produces XML like this... <?xml version="1.0" encoding="utf-8"?> <Element1> <Element2> <Element3> <ELEMENT4>content</ELEMENT4> </Element3> </Element2> </Element1> On the new 11.2 system it looks like this... <?xml version="1.0" encoding="utf-8"?> <Element1> <Element3> <ELEMENT4>content</ELEMENT4> </Element3> </Element1> Is there some environmental variable I am missing that tells Oracle how to format its XML. There are hundreds of thousands of lines of PL/SQL in the database; it would be a mammoth task to rewrite if it turned out they had changed they way Oracle formats XML between versions. Hopefully someone has come accross this before. Thanks

    Read the article

  • loading an xml in web apps directory from a library dll

    - by Blankman
    my web application has an xml file here: /files/xml/test.xml I need to load a XDocument from within a class library project, how will I reference the xml? I don't want to pass any path parameters to this method. I want to assume the location is fixed at /files/xml/test.xml. How can I load a XDocument know this? I don't seem to have access to server.mappath either.

    Read the article

  • Intercepting POST in WebView using NDK

    - by ravi
    I am trying to intercept http POST method in WebView android, but not able to find any suitable method for the same. In API 11 there is a method shouldInterceptRequest, but it gives only webviewq and url as parameters so cater only GET request, it doesnot provide POST body data and request type indicator. My question : Is there any way to override this method in android NDK ? or if i can pass a flag which identify request and also i can provide POST data. Also if you have any other solution, tell me.

    Read the article

  • How can I run an android frame animation without it skewing?

    - by GameDev123
    I have a small state machine that runs a series of frame by frame animations in an ImageView, in a nested hierarchy of layouts. There is more than adequate space to display each frame of the animation. Each frame of the animation is cropped to fit the minimum amount of area, in order to save memory. If a frame only contains 50x50 worth of pixels then the png is 50x50. There is no transparent padding to keep them the same size. The ImageView is directly within a RelativeLayout, and is anchored to the bottom left with some padding. The general idea being that the character in the animation performs some action, which results in individual frames of the animation growing or shrinking. The issue is that individual frames of animation are skewed, and there does not appear to be any way of preventing this. If I set the source of the imageview directly to one of the frames of animation, it displays fine in the layout manager. I have tried this with Adjust View Bounds set to true, false, and undefined. I have tried using the background and the src attribute of imageview to set the animation drawable, I have tried every configuration of layout manager and setting minimum/maximum size that I can think of, and it still stretches the character on various frames depending on the size of the source png. In essence, all I want to do is say "I want this ImageView to anchor in the bottom left and then display any frame that happens to be in it without stretching or skewing it in any way aside from that which occurred when the frame png's were loaded." Seems simple, but I have yet to come across any way of doing it. Here is the layout of the imageview as of my last test, I had to remove bits of the XML to get it to display but nothing pertinent: RelativeLayout android:orientation="horizontal" android:layout_above="@+id/MenuOptions" android:layout_width="fill_parent" android:id="@+id/AnimationLayout" android:clipChildren="false" android:minHeight="180dp" android:layout_height="fill_parent" android:layout_below="@+id/GameBarLayout" ImageView android:id="@+id/animatedImg" android:layout_height="wrap_content" android:layout_width="wrap_content" android:visibility="visible" android:baselineAlignBottom="true" android:minHeight="180dp" android:minWidth="200dp" android:adjustViewBounds="true" android:layout_alignParentBottom="true" android:paddingLeft="30dp" android:paddingBottom="10dp" android:src="@drawable/idle01"/ImageView /RelativeLayout Here is how an animation is set up: animationDrawable = new AnimationDrawable(); animationDrawable.addFrame(res.getDrawable(R.drawable.idle01), 16); animationDrawable.addFrame(res.getDrawable(R.drawable.idle02), 16); animationDrawable.addFrame(res.getDrawable(R.drawable.idle03), 16);

    Read the article

  • Android layouts within layouts, with separate classes handling their input?

    - by Demonofloom
    Hey all, I have created a program in Java that uses Jpanels within Jpanels. One example of this is having a side view containing buttons that change the main view when pressed. The main view also has buttons that can be used to alter itself. I am trying to re-create this on the android. I have my layout set up from an xml, with a side panel containing buttons and the main view. There is another xml that contains what I want in the main view. Now I am struggling to get this separate xml to be displayed in the main view and can’t figure out how I would get the class to handle its own input. I don’t want to paste the code into the main.xml as I want to keep things object orientated and each view needs some custom elements such as different textviews. An example of what I am trying to convert for the android is below:- //The ViewInt class has its own layout ViewInt tempView = new ViewInt(i, mFloorNo); //The viewInt class is then added to the main window. mainWindowPanel.add(tempView); This small bit of code would create a view, add it to the main view and then any input in the main window is handled by that class, but at the same time any input not in this main window is handled by another class (probably the root class). Any help is greatly appreciated, thanks. To clarify: The program has a side panel layout, containing buttons. And a main view layout that is empty. I am trying to set a .xml layout to this main view layout, and have it so that if any buttons are pressed in that main view then a class for that layout will handle it.

    Read the article

  • Google Play: how dev can give (already purchased) app to customer as a gift?

    - by Tertium
    Yes, SO, I know, it's not a "programmer's" question:) But customers sometimes help us (devs) with our code, so we (devs) shold be grateful. I think answer to my question will be useful for all fellow android devs. User has purchased my app. Refund period (15min) is over of course. Now I'd like to return money to him as a gift, because he helped me in testing a little. If I refund the entire order in Checkout-Orders will user keep my app 'purchased'? I mean will he be able to uninstall and install it again from GooglePlay-MyApps and will app be marked "purchased"? Will Google LVL accept him to run the app? I've done such refunds before, but then they called it "Android Market", and refund was 12h, and there were no LVL. Maybe somebody know another way to make a small gift using Google Play?

    Read the article

  • Game doesn't Quit properly

    - by W.K.S
    I have an app that so far consists of two Activities: The Main Menu Activity. The Game Activity The Main Menu Activity contains a button that starts the Game Activity with the following code: public void onClick(View clickedButton) { switch(clickedButton.getId()) { case R.id.buttonPlay: Intent i = new Intent("apple.banana.BouncingBallActivity"); startActivity(i); break; } When the user is done with the Game Activity, he presses the back button. This calls the onPause() method first, which pauses the animation thread of the game. It then calls the onStop() which calls finish() on the activity altogether. The user is returned to the Main Menu activity. The code is outlined below: public class BouncingBallActivity extends Activity{ private BouncingBallView bouncingBallView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); bouncingBallView = new BouncingBallView(this); bouncingBallView.resume(); setContentView(bouncingBallView); } @Override protected void onPause() { super.onPause(); bouncingBallView.pause(); } @Override protected void onResume() { super.onResume(); bouncingBallView.resume(); } @Override protected void onStop() { super.onStop(); this.finish(); } } The problem is that this only works if I launch the application from Eclipse. When I click on the app icon, the game starts from the Game Activity. The main menu activity does not appear. I am not clear about why this happens. It could be something to do with the manifest. I've pasted the relevant portions below: <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".BouncingBallActivity" android:label="@string/app_name" android:screenOrientation="landscape" > <intent-filter> <action android:name="apple.banana.BouncingBallActivity" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".MainMenu" android:label="@string/app_name" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> I'd really appreciate any help with this. Thanks.

    Read the article

  • XML Schema For MBSA Reports

    - by Steve Hawkins
    I'm in the process of creating a script to run the command line version of Microsoft Baseline Security Analyzer (mbsacli.exe) against all of our servers. Since the MBSA reports are provided as XML documents, I should be able to write a script or small program to parse the XML looking for errors / issues. I'm wondering if anyone knows whether or not the XML schema for the MBSA reports is documented anywhere -- I have goggled this, and cant seem to find any trace of it. I've run across a few articles that address bits and pieces, but nothing that addresses the complete schema. Yes, I could just reverse engineer the XML, but I would like to understand a little more about the meaning of some of the tags. Thanks...

    Read the article

  • IE 7 opens .zip files as XML documents

    - by EdmundG
    When I try clicking on a zip file link on a web page, IE 7 tries to open it as an XML document and displays: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again. I get around this by right-clicking and using Save Target As... Double clicking on a .zip in the file system opens my zip program without problems. How do I fix this problem?

    Read the article

  • How to Create an XML File from an Excel File

    - by nicorellius
    I have an Excel spreadsheet file that has 5 or so columns and hundreds of lines. I need to convert this (export these data) to an XML file. I'm interested in three of the columns and they correspond to these XML tags, where info1 can be followed by info2, info3, etc... <?xml version="1.0" encoding="UTF-8" ?> <list> <info1> <id>111</id> <value>222</value> <des>333</des> </info1> </list> If possible, I would like to avoid building this XML manually. It wouldn't be too much trouble to rearrange the Excel file such that the three columns I'm interested in were in their own file. But then I would need to export those data into an XML file of the above format. Any ideas?

    Read the article

  • DB2 runstats not working for xml columns

    - by Keshav Prasad
    Hello, I am running runstats command to update the runtime statistics of a particular table called "CUSTOMER" in DB2. The customer has two columns- CID (integer) and INFO (xml column). After running the command, if I look into the SYSCOLDIST table, the information for column CID is populated correctly. But there is nothing filled for the INFO xml column. The same happens with a different table that has xml columns. Please help.. Thanks, -Keshav

    Read the article

  • how to recover my xml default icon?

    - by moonway
    My XML files are showing the unknown programs icon, you can see in this picture: i cant revise its icon why? i look it up in the registry i find no error look at the following Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT.xml] @="xmlfile" "Content Type"="text/xml" "PerceivedType"="text" [HKEY_CLASSES_ROOT.xml\PersistentHandler] @="{7E9D8D44-6926-426F-AA2B-217A819A5CCE}" Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\xmlfile] @="@C:\Windows\System32\msxml3r.dll,-1" "EditFlags"=hex:00,00,00,00 "FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\ 00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\ 32,00,5c,00,6d,00,73,00,78,00,6d,00,6c,00,33,00,72,00,2e,00,64,00,6c,00,6c,\ 00,2c,00,2d,00,31,00,00,00 [HKEY_CLASSES_ROOT\xmlfile\BrowseInPlace] [HKEY_CLASSES_ROOT\xmlfile\CLSID] @="{48123BC4-99D9-11D1-A6B3-00C04FD91555}" [HKEY_CLASSES_ROOT\xmlfile\DefaultIcon] @="C:\Windows\System32\msxml3.dll,0" [HKEY_CLASSES_ROOT\xmlfile\shell] @="open" [HKEY_CLASSES_ROOT\xmlfile\shell\edit] [HKEY_CLASSES_ROOT\xmlfile\shell\edit\command] @="\"C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSOXMLED.EXE\" /verb edit \"%1\"" [HKEY_CLASSES_ROOT\xmlfile\shell\Open] [HKEY_CLASSES_ROOT\xmlfile\shell\Open\Command] @="\"C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSOXMLED.EXE\" /verb open \"%1\"" [HKEY_CLASSES_ROOT\xmlfile\shell\Open\ddeexec] @="" [HKEY_CLASSES_ROOT\xmlfile\ShellEx] [HKEY_CLASSES_ROOT\xmlfile\ShellEx\IconHandler] @="{AB968F1E-E20B-403A-9EB8-72EB0EB6797E}" can you find something wrong or you can paste your reg hehe i need default reg about xml which is with default associated exe all right!

    Read the article

  • Restoring android after ubuntu touch fails

    - by deimus
    I'm trying to restore android after playing around with ubuntu touch I follow exactly the same steps described the ubuntu's wiki page i.e. Download the factory image corresponding to your device's model and version (initial table has links). Ensure the device is connected and powered on. Extract the downloaded file and cd into the extracted directory. run adb reboot-bootloader run ./flash-all.sh (use sudo if lack of permissions on the workstation don't allow you to talk to the device). The archive is downloaded successfully, checked the sha1 checksum everything is ok. But the ./flash-all.sh fails like this sending 'bootloader' (2308 KB)... OKAY [ 0.513s] writing 'bootloader'... OKAY [ 0.292s] finished. total time: 0.805s rebooting into bootloader... OKAY [ 0.007s] finished. total time: 0.008s sending 'radio' (12288 KB)... OKAY [ 2.668s] writing 'radio'... OKAY [ 1.372s] finished. total time: 4.040s rebooting into bootloader... OKAY [ 0.009s] finished. total time: 0.009s archive does not contain 'boot.sig' archive does not contain 'recovery.sig' failed to allocate 435793780 bytes error: update package missing system.img My device is Nexus 4. Tried both 4.2.2 and 4.3 androind versions for Nexus 4 still the same. Any ideas how problem can be solved ?

    Read the article

  • Android Design - Service vs Thread for Networking

    - by Nevyn
    I am writing an Android app, finally (yay me) and for this app I need persistant, but user closeable, network sockets (yes, more than one). I decided to try my hand at writing my own version of an IRC Client. My design issue however, is I'm not sure how to run the Socket connectivity itself. If I put the sockets at the Activity level, they keeps getting closed shortly after the Activity becomes non-visible (also a problem that needs solving...but I think i figured that one out)...but if I run a "connectivity service", I need to find out if I can have multiple instances of it running (the service, that is...one per server/socket). Either that or a I need a way to Thread the sockets themselves and have multiple threads running that I can still communicate with directly (ID system of some sort). Thus the question: Is it a 'better', or at least more "proper" design pattern, to put the Socket and networking in a service, and have the Activities consume said service...or should I tie the sockets directly to some Threaded Process owned by the UI Activity and not bother with the service implementation at all? I do know better than to put the networking directly on the UI thread, but that's as far as I've managed to get.

    Read the article

  • create a simple game board android

    - by user2819446
    I am a beginner in Android and I want to create a very simple 2D game. I've already programmed a Tic-Tac-Toe game. The drawing of the game board and connecting it with my game and input logic was quite difficult (as it was done separately, canvas drawing, calculating positions, etc). By now I figured out that there must be a simpler way. All I want is a simple grid; something like this: http://www.blelb.com/deutsch/blelbspots/spot29/images/hermannneg.gif. The edges should be visible and black, and each cell editable, containing either an image or nothing, so I can detect if the player is on that cell or not, move it... Think of it as Chess or something similar. Searching the internet during the last days, I am a bit overwhelmed of all the different options. After all, I think Gridview or Gridlayout is what I am searching for, but I'm still stuck. I hope you can help me with some good advice or maybe a link to a nice tutorial. I have checked several already, and none were exactly what I was searching for.

    Read the article

  • Functional Languages that compile to Android's Dalvik VM?

    - by Berin Loritsch
    I have a software problem that fits the functional approach to programming, but the target market will be on the Android OS. I ask because there are functional languages that compile to Java's VM, but Dalvik bytecode != Java bytecode. Alternatively, do you know if the dx utility can intelligently convert the .class files generated from functional languages like Scala? Edit: In order to add a bit more helpfulness to the community, and also to help me choose better, can I refine the question a bit? Have you used any alternate languages with Dalvik? Which ones? What are some "gotchas" (problems) that I might run into? Is performance acceptable? By that, I mean the application still feels responsive to the user. I've never done mobile phone development, but I grew up on constrained devices and I'm under no illusion that there is a cost to using non-standard languages with the platform. I just need to know if the cost is such that I should shoe-horn my approach into default language (i.e. apply functional principles in the OOP language).

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >